From 516bfb31f48a949657e8ae160c2bb772a846a1ef Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 Mar 2025 19:29:44 +0000 Subject: [PATCH] CodeGen from PR 33053 in Azure/azure-rest-api-specs Merge 756aed8b5ca198f17e6065a1dce3e4de462bd5c8 into 94b023458e408d9853fc485cccc22f5e776d43ff --- .../network/armnetwork/CHANGELOG.md | 137 + .../network/armnetwork/README.md | 2 +- .../armnetwork/adminrulecollections_client.go | 25 +- ...dminrulecollections_client_example_test.go | 184 - .../network/armnetwork/adminrules_client.go | 25 +- .../adminrules_client_example_test.go | 389 --- ...atewayprivateendpointconnections_client.go | 34 +- ...endpointconnections_client_example_test.go | 169 - ...ationgatewayprivatelinkresources_client.go | 9 +- ...rivatelinkresources_client_example_test.go | 58 - .../armnetwork/applicationgateways_client.go | 113 +- ...applicationgateways_client_example_test.go | 2346 ------------- ...cationgatewaywafdynamicmanifests_client.go | 9 +- ...wafdynamicmanifests_client_example_test.go | 92 - ...iongatewaywafdynamicmanifests_live_test.go | 2 +- ...atewaywafdynamicmanifestsdefault_client.go | 12 +- ...micmanifestsdefault_client_example_test.go | 84 - .../applicationsecuritygroup_live_test.go | 2 +- .../applicationsecuritygroups_client.go | 43 +- ...ationsecuritygroups_client_example_test.go | 242 -- .../network/armnetwork/autorest.md | 7 +- .../armnetwork/availabledelegations_client.go | 9 +- ...vailabledelegations_client_example_test.go | 54 - .../availabledelegations_live_test.go | 2 +- .../availableendpointservices_client.go | 9 +- ...bleendpointservices_client_example_test.go | 61 - .../availableprivateendpointtypes_client.go | 15 +- ...rivateendpointtypes_client_example_test.go | 84 - ...vailableresourcegroupdelegations_client.go | 9 +- ...rcegroupdelegations_client_example_test.go | 54 - .../availableservicealiases_client.go | 15 +- ...lableservicealiases_client_example_test.go | 98 - .../availableservicealiases_live_test.go | 2 +- .../azurefirewallfqdntag_live_test.go | 2 +- .../azurefirewallfqdntags_client.go | 9 +- ...urefirewallfqdntags_client_example_test.go | 60 - .../armnetwork/azurefirewalls_client.go | 61 +- .../azurefirewalls_client_example_test.go | 2987 ---------------- .../armnetwork/azurewebcategory_live_test.go | 2 +- .../armnetwork/bastionhost_live_test.go | 2 +- .../network/armnetwork/bastionhosts_client.go | 45 +- .../bastionhosts_client_example_test.go | 980 ------ .../bgpservicecommunities_client.go | 9 +- ...pservicecommunities_client_example_test.go | 84 - .../checkdnsavailability_live_test.go | 2 +- .../network/armnetwork/client_factory.go | 83 +- .../configurationpolicygroups_client.go | 31 +- ...urationpolicygroups_client_example_test.go | 226 -- .../armnetwork/connectionmonitors_client.go | 207 +- .../connectionmonitors_client_example_test.go | 721 ---- .../connectivityconfigurations_client.go | 25 +- ...ivityconfigurations_client_example_test.go | 228 -- .../network/armnetwork/constants.go | 293 +- .../armnetwork/customipprefix_live_test.go | 2 +- .../armnetwork/customipprefixes_client.go | 41 +- .../customipprefixes_client_example_test.go | 627 ---- .../armnetwork/ddoscustompolicies_client.go | 31 +- .../ddoscustompolicies_client_example_test.go | 145 - .../ddosprotectionplan_live_test.go | 2 +- .../armnetwork/ddosprotectionplans_client.go | 43 +- ...ddosprotectionplans_client_example_test.go | 296 -- .../armnetwork/defaultsecurityrules_client.go | 15 +- ...efaultsecurityrules_client_example_test.go | 234 -- .../armnetwork/dscpconfiguration_client.go | 37 +- .../dscpconfiguration_client_example_test.go | 602 ---- .../armnetwork/endpointservice_live_test.go | 2 +- .../expressroutecircuit_live_test.go | 2 +- ...xpressroutecircuitauthorizations_client.go | 31 +- ...rcuitauthorizations_client_example_test.go | 143 - .../expressroutecircuitconnections_client.go | 31 +- ...ecircuitconnections_client_example_test.go | 206 -- .../expressroutecircuitpeerings_client.go | 31 +- ...outecircuitpeerings_client_example_test.go | 266 -- .../armnetwork/expressroutecircuits_client.go | 79 +- ...xpressroutecircuits_client_example_test.go | 644 ---- .../expressrouteconnections_client.go | 31 +- ...essrouteconnections_client_example_test.go | 266 -- ...ressroutecrossconnectionpeerings_client.go | 31 +- ...sconnectionpeerings_client_example_test.go | 195 -- .../expressroutecrossconnections_client.go | 57 +- ...utecrossconnections_client_example_test.go | 366 -- .../armnetwork/expressroutegateways_client.go | 45 +- ...xpressroutegateways_client_example_test.go | 337 -- .../armnetwork/expressroutelinks_client.go | 15 +- .../expressroutelinks_client_example_test.go | 108 - .../expressrouteportauthorizations_client.go | 31 +- ...eportauthorizations_client_example_test.go | 148 - .../armnetwork/expressrouteports_client.go | 49 +- .../expressrouteports_client_example_test.go | 519 --- .../expressrouteportslocations_client.go | 15 +- ...routeportslocations_client_example_test.go | 95 - ...xpressrouteproviderportslocation_client.go | 7 +- ...oviderportslocation_client_example_test.go | 73 - .../expressrouteserviceproviders_client.go | 9 +- ...uteserviceproviders_client_example_test.go | 90 - .../fake/adminrulecollections_server.go | 66 +- .../armnetwork/fake/adminrules_server.go | 66 +- ...atewayprivateendpointconnections_server.go | 66 +- ...ationgatewayprivatelinkresources_server.go | 54 +- .../fake/applicationgateways_server.go | 132 +- ...cationgatewaywafdynamicmanifests_server.go | 54 +- ...atewaywafdynamicmanifestsdefault_server.go | 54 +- .../fake/applicationsecuritygroups_server.go | 74 +- .../fake/availabledelegations_server.go | 54 +- .../fake/availableendpointservices_server.go | 54 +- .../availableprivateendpointtypes_server.go | 58 +- ...vailableresourcegroupdelegations_server.go | 54 +- .../fake/availableservicealiases_server.go | 58 +- .../fake/azurefirewallfqdntags_server.go | 54 +- .../armnetwork/fake/azurefirewalls_server.go | 90 +- .../armnetwork/fake/bastionhosts_server.go | 74 +- .../fake/bgpservicecommunities_server.go | 54 +- .../fake/configurationpolicygroups_server.go | 66 +- .../fake/connectionmonitors_server.go | 200 +- .../fake/connectivityconfigurations_server.go | 66 +- .../fake/customipprefixes_server.go | 74 +- .../fake/ddoscustompolicies_server.go | 66 +- .../fake/ddosprotectionplans_server.go | 74 +- .../fake/defaultsecurityrules_server.go | 58 +- .../fake/dscpconfiguration_server.go | 70 +- ...xpressroutecircuitauthorizations_server.go | 66 +- .../expressroutecircuitconnections_server.go | 66 +- .../expressroutecircuitpeerings_server.go | 66 +- .../fake/expressroutecircuits_server.go | 96 +- .../fake/expressrouteconnections_server.go | 66 +- ...ressroutecrossconnectionpeerings_server.go | 66 +- .../expressroutecrossconnections_server.go | 84 +- .../fake/expressroutegateways_server.go | 74 +- .../fake/expressroutelinks_server.go | 58 +- .../expressrouteportauthorizations_server.go | 66 +- .../fake/expressrouteports_server.go | 78 +- .../fake/expressrouteportslocations_server.go | 58 +- ...xpressrouteproviderportslocation_server.go | 54 +- .../expressrouteserviceproviders_server.go | 54 +- .../fake/firewallpolicies_server.go | 74 +- .../fake/firewallpolicydeployments_server.go | 60 +- .../fake/firewallpolicydrafts_server.go | 64 +- .../firewallpolicyidpssignatures_server.go | 54 +- ...policyidpssignaturesfiltervalues_server.go | 54 +- ...allpolicyidpssignaturesoverrides_server.go | 68 +- ...lpolicyrulecollectiongroupdrafts_server.go | 64 +- ...rewallpolicyrulecollectiongroups_server.go | 66 +- .../armnetwork/fake/flowlogs_server.go | 76 +- .../network/armnetwork/fake/groups_server.go | 66 +- .../armnetwork/fake/hubroutetables_server.go | 66 +- .../hubvirtualnetworkconnections_server.go | 66 +- .../armnetwork/fake/inboundnatrules_server.go | 66 +- .../fake/inboundsecurityrule_server.go | 58 +- .../fake/interfaceipconfigurations_server.go | 58 +- .../fake/interfaceloadbalancers_server.go | 54 +- .../armnetwork/fake/interfaces_server.go | 116 +- .../fake/interfacetapconfigurations_server.go | 66 +- .../network/armnetwork/fake/internal.go | 8 +- .../armnetwork/fake/ipallocations_server.go | 74 +- .../armnetwork/fake/ipampools_server.go | 84 +- .../armnetwork/fake/ipgroups_server.go | 74 +- .../loadbalancerbackendaddresspools_server.go | 66 +- ...balancerfrontendipconfigurations_server.go | 58 +- .../loadbalancerloadbalancingrules_server.go | 62 +- .../loadbalancernetworkinterfaces_server.go | 54 +- .../fake/loadbalanceroutboundrules_server.go | 58 +- .../fake/loadbalancerprobes_server.go | 58 +- .../armnetwork/fake/loadbalancers_server.go | 94 +- .../fake/localnetworkgateways_server.go | 70 +- .../armnetwork/fake/management_server.go | 120 +- ...ntgroupnetworkmanagerconnections_server.go | 66 +- .../armnetwork/fake/managercommits_server.go | 54 +- .../fake/managerdeploymentstatus_server.go | 54 +- .../managerroutingconfigurations_server.go | 66 +- .../armnetwork/fake/managers_server.go | 74 +- .../armnetwork/fake/natgateways_server.go | 74 +- .../armnetwork/fake/natrules_server.go | 66 +- .../fake/nspassociationreconcile_server.go | 130 + .../armnetwork/fake/operations_server.go | 54 +- .../armnetwork/fake/p2svpngateways_server.go | 102 +- .../armnetwork/fake/packetcaptures_server.go | 92 +- ...erexpressroutecircuitconnections_server.go | 58 +- .../armnetwork/fake/polymorphic_helpers.go | 5 +- .../fake/privatednszonegroups_server.go | 66 +- .../fake/privateendpoints_server.go | 70 +- .../fake/privatelinkservices_server.go | 104 +- .../armnetwork/fake/profiles_server.go | 74 +- .../fake/publicipaddresses_server.go | 104 +- .../fake/publicipprefixes_server.go | 74 +- .../reachabilityanalysisintents_server.go | 66 +- .../fake/reachabilityanalysisruns_server.go | 72 +- .../fake/resourcenavigationlinks_server.go | 54 +- .../fake/routefilterrules_server.go | 66 +- .../armnetwork/fake/routefilters_server.go | 74 +- .../armnetwork/fake/routemaps_server.go | 66 +- .../network/armnetwork/fake/routes_server.go | 66 +- .../armnetwork/fake/routetables_server.go | 74 +- .../armnetwork/fake/routingintent_server.go | 66 +- .../fake/routingrulecollections_server.go | 66 +- .../armnetwork/fake/routingrules_server.go | 66 +- .../fake/scopeconnections_server.go | 66 +- .../securityadminconfigurations_server.go | 66 +- .../armnetwork/fake/securitygroups_server.go | 74 +- .../fake/securitypartnerproviders_server.go | 74 +- .../securityperimeteraccessrules_server.go | 363 ++ ...perimeterassociableresourcetypes_server.go | 130 + .../securityperimeterassociations_server.go | 322 ++ .../securityperimeterlinkreferences_server.go | 262 ++ .../fake/securityperimeterlinks_server.go | 309 ++ ...typerimeterloggingconfigurations_server.go | 268 ++ ...curityperimeteroperationstatuses_server.go | 122 + .../fake/securityperimeterprofiles_server.go | 296 ++ .../fake/securityperimeters_server.go | 404 +++ .../armnetwork/fake/securityrules_server.go | 66 +- .../fake/securityuserconfigurations_server.go | 66 +- .../securityuserrulecollections_server.go | 66 +- .../fake/securityuserrules_server.go | 66 +- .../network/armnetwork/fake/server_factory.go | 678 +++- .../fake/serviceassociationlinks_server.go | 54 +- .../fake/serviceendpointpolicies_server.go | 74 +- ...serviceendpointpolicydefinitions_server.go | 66 +- .../fake/servicetaginformation_server.go | 54 +- .../armnetwork/fake/servicetags_server.go | 54 +- .../armnetwork/fake/staticcidrs_server.go | 72 +- .../armnetwork/fake/staticmembers_server.go | 66 +- .../network/armnetwork/fake/subnets_server.go | 86 +- ...riptionnetworkmanagerconnections_server.go | 66 +- .../network/armnetwork/fake/time_rfc3339.go | 6 +- .../network/armnetwork/fake/usages_server.go | 54 +- .../fake/verifierworkspaces_server.go | 76 +- .../network/armnetwork/fake/vipswap_server.go | 68 +- .../virtualapplianceconnections_server.go | 66 +- .../fake/virtualappliances_server.go | 198 +- .../fake/virtualappliancesites_server.go | 66 +- .../fake/virtualapplianceskus_server.go | 58 +- .../fake/virtualhubbgpconnection_server.go | 62 +- .../fake/virtualhubbgpconnections_server.go | 62 +- .../fake/virtualhubipconfiguration_server.go | 66 +- .../fake/virtualhubroutetablev2s_server.go | 66 +- .../armnetwork/fake/virtualhubs_server.go | 88 +- ...virtualnetworkgatewayconnections_server.go | 106 +- .../virtualnetworkgatewaynatrules_server.go | 66 +- .../fake/virtualnetworkgateways_server.go | 514 ++- .../fake/virtualnetworkpeerings_server.go | 66 +- .../armnetwork/fake/virtualnetworks_server.go | 88 +- .../fake/virtualnetworktaps_server.go | 74 +- .../fake/virtualrouterpeerings_server.go | 66 +- .../armnetwork/fake/virtualrouters_server.go | 70 +- .../armnetwork/fake/virtualwans_server.go | 74 +- .../armnetwork/fake/vpnconnections_server.go | 74 +- .../armnetwork/fake/vpngateways_server.go | 88 +- .../fake/vpnlinkconnections_server.go | 86 +- .../fake/vpnserverconfigurations_server.go | 74 +- ...urationsassociatedwithvirtualwan_server.go | 54 +- .../fake/vpnsitelinkconnections_server.go | 54 +- .../armnetwork/fake/vpnsitelinks_server.go | 58 +- .../armnetwork/fake/vpnsites_server.go | 74 +- .../fake/vpnsitesconfiguration_server.go | 60 +- .../armnetwork/fake/watchers_server.go | 130 +- .../webapplicationfirewallpolicies_server.go | 70 +- .../armnetwork/fake/webcategories_server.go | 58 +- .../armnetwork/firewallpolicies_client.go | 41 +- .../firewallpolicies_client_example_test.go | 601 ---- .../armnetwork/firewallpolicy_live_test.go | 2 +- .../firewallpolicydeployments_client.go | 11 +- ...llpolicydeployments_client_example_test.go | 39 - .../armnetwork/firewallpolicydrafts_client.go | 21 +- ...irewallpolicydrafts_client_example_test.go | 311 -- .../firewallpolicyidpssignatures_client.go | 9 +- ...olicyidpssignatures_client_example_test.go | 87 - ...policyidpssignaturesfiltervalues_client.go | 9 +- ...naturesfiltervalues_client_example_test.go | 47 - ...allpolicyidpssignaturesoverrides_client.go | 27 +- ...signaturesoverrides_client_example_test.go | 166 - ...lpolicyrulecollectiongroupdrafts_client.go | 21 +- ...llectiongroupdrafts_client_example_test.go | 160 - ...rewallpolicyrulecollectiongroups_client.go | 31 +- ...ulecollectiongroups_client_example_test.go | 866 ----- .../network/armnetwork/flowlogs_client.go | 37 +- .../flowlogs_client_example_test.go | 341 -- sdk/resourcemanager/network/armnetwork/go.mod | 4 +- .../network/armnetwork/groups_client.go | 23 +- .../armnetwork/groups_client_example_test.go | 172 - .../armnetwork/hubroutetables_client.go | 31 +- .../hubroutetables_client_example_test.go | 186 - .../hubvirtualnetworkconnections_client.go | 31 +- ...lnetworkconnections_client_example_test.go | 278 -- .../armnetwork/inboundnatrules_client.go | 29 +- .../inboundnatrules_client_example_test.go | 200 -- .../armnetwork/inboundsecurityrule_client.go | 17 +- ...inboundsecurityrule_client_example_test.go | 118 - .../interfaceipconfigurations_client.go | 15 +- ...aceipconfigurations_client_example_test.go | 110 - .../interfaceloadbalancers_client.go | 9 +- ...erfaceloadbalancers_client_example_test.go | 162 - .../network/armnetwork/interfaces.go | 3 - .../network/armnetwork/interfaces_client.go | 77 +- .../interfaces_client_example_test.go | 1403 -------- .../interfacetapconfigurations_client.go | 31 +- ...cetapconfigurations_client_example_test.go | 154 - .../armnetwork/ipallocations_client.go | 41 +- .../ipallocations_client_example_test.go | 276 -- .../network/armnetwork/ipampools_client.go | 45 +- .../ipampools_client_example_test.go | 351 -- .../network/armnetwork/ipgroups_client.go | 41 +- .../ipgroups_client_example_test.go | 320 -- .../network/armnetwork/ipgroups_live_test.go | 2 +- .../armnetwork/loadbalancer_live_test.go | 2 +- .../loadbalancerbackendaddresspools_client.go | 31 +- ...backendaddresspools_client_example_test.go | 312 -- ...balancerfrontendipconfigurations_client.go | 15 +- ...endipconfigurations_client_example_test.go | 112 - .../loadbalancerloadbalancingrules_client.go | 23 +- ...rloadbalancingrules_client_example_test.go | 152 - .../loadbalancernetworkinterfaces_client.go | 9 +- ...ernetworkinterfaces_client_example_test.go | 210 -- .../loadbalanceroutboundrules_client.go | 15 +- ...lanceroutboundrules_client_example_test.go | 106 - .../armnetwork/loadbalancerprobes_client.go | 15 +- .../loadbalancerprobes_client_example_test.go | 104 - .../armnetwork/loadbalancers_client.go | 61 +- .../loadbalancers_client_example_test.go | 3017 ----------------- .../armnetwork/localnetworkgateways_client.go | 37 +- ...ocalnetworkgateways_client_example_test.go | 230 -- .../network/armnetwork/management_client.go | 89 +- .../management_client_example_test.go | 654 ---- ...ntgroupnetworkmanagerconnections_client.go | 25 +- ...kmanagerconnections_client_example_test.go | 164 - .../armnetwork/managercommits_client.go | 11 +- .../managercommits_client_example_test.go | 57 - .../managerdeploymentstatus_client.go | 7 +- ...gerdeploymentstatus_client_example_test.go | 71 - .../managerroutingconfigurations_client.go | 25 +- ...utingconfigurations_client_example_test.go | 168 - .../network/armnetwork/managers_client.go | 35 +- .../managers_client_example_test.go | 316 -- .../network/armnetwork/models.go | 722 +++- .../network/armnetwork/models_serde.go | 2814 ++++++++++++--- .../armnetwork/natgateway_live_test.go | 2 +- .../network/armnetwork/natgateways_client.go | 41 +- .../natgateways_client_example_test.go | 359 -- .../network/armnetwork/natrules_client.go | 31 +- .../natrules_client_example_test.go | 172 - .../armnetwork/networkinterface_live_test.go | 2 +- .../armnetwork/networkmanager_live_test.go | 2 +- .../networkmanagerconnection_live_test.go | 2 +- ...agerconnectivityconfiguration_live_test.go | 2 +- .../networkmanagergroup_live_test.go | 2 +- ...gersecurityadminconfiguration_live_test.go | 2 +- .../armnetwork/networkprofile_live_test.go | 2 +- .../networksecuritygroup_live_test.go | 2 +- .../armnetwork/networkwatcher_live_test.go | 2 +- .../nspassociationreconcile_client.go | 116 + .../network/armnetwork/operation_live_test.go | 2 +- .../network/armnetwork/operations_client.go | 9 +- .../operations_client_example_test.go | 166 - .../network/armnetwork/options.go | 858 +++-- .../armnetwork/p2svpngateways_client.go | 85 +- .../p2svpngateways_client_example_test.go | 1079 ------ .../armnetwork/packetcaptures_client.go | 47 +- .../packetcaptures_client_example_test.go | 246 -- ...erexpressroutecircuitconnections_client.go | 15 +- ...ecircuitconnections_client_example_test.go | 120 - .../network/armnetwork/polymorphic_helpers.go | 3 - .../armnetwork/privatednszonegroups_client.go | 31 +- ...rivatednszonegroups_client_example_test.go | 253 -- .../armnetwork/privateendpoints_client.go | 35 +- .../privateendpoints_client_example_test.go | 941 ----- .../armnetwork/privatelinkservices_client.go | 87 +- ...privatelinkservices_client_example_test.go | 798 ----- .../network/armnetwork/profiles_client.go | 39 +- .../profiles_client_example_test.go | 684 ---- .../armnetwork/publicipaddress_live_test.go | 2 +- .../armnetwork/publicipaddresses_client.go | 69 +- .../publicipaddresses_client_example_test.go | 863 ----- .../armnetwork/publicipprefix_live_test.go | 2 +- .../armnetwork/publicipprefixes_client.go | 41 +- .../publicipprefixes_client_example_test.go | 399 --- .../reachabilityanalysisintents_client.go | 25 +- ...lityanalysisintents_client_example_test.go | 220 -- .../reachabilityanalysisruns_client.go | 27 +- ...abilityanalysisruns_client_example_test.go | 222 -- .../resourcenavigationlinks_client.go | 9 +- ...urcenavigationlinks_client_example_test.go | 52 - .../network/armnetwork/responses.go | 372 +- .../network/armnetwork/responses_serde.go | 123 + .../armnetwork/routefilterrules_client.go | 31 +- .../routefilterrules_client_example_test.go | 159 - .../network/armnetwork/routefilters_client.go | 41 +- .../routefilters_client_example_test.go | 326 -- .../network/armnetwork/routemaps_client.go | 31 +- .../routemaps_client_example_test.go | 265 -- .../network/armnetwork/routes_client.go | 31 +- .../armnetwork/routes_client_example_test.go | 153 - .../armnetwork/routetable_live_test.go | 2 +- .../network/armnetwork/routetables_client.go | 41 +- .../routetables_client_example_test.go | 333 -- .../armnetwork/routingintent_client.go | 31 +- .../routingintent_client_example_test.go | 194 -- .../routingrulecollections_client.go | 25 +- ...tingrulecollections_client_example_test.go | 187 - .../network/armnetwork/routingrules_client.go | 25 +- .../routingrules_client_example_test.go | 199 -- .../armnetwork/scopeconnections_client.go | 25 +- .../scopeconnections_client_example_test.go | 169 - .../securityadminconfigurations_client.go | 25 +- ...adminconfigurations_client_example_test.go | 219 -- .../armnetwork/securitygroups_client.go | 41 +- .../securitygroups_client_example_test.go | 1106 ------ .../securitypartnerproviders_client.go | 43 +- ...itypartnerproviders_client_example_test.go | 261 -- .../securityperimeteraccessrules_client.go | 417 +++ ...perimeterassociableresourcetypes_client.go | 104 + .../securityperimeterassociations_client.go | 352 ++ .../securityperimeterlinkreferences_client.go | 266 ++ .../securityperimeterlinks_client.go | 340 ++ ...typerimeterloggingconfigurations_client.go | 312 ++ ...curityperimeteroperationstatuses_client.go | 107 + .../securityperimeterprofiles_client.go | 318 ++ .../armnetwork/securityperimeters_client.go | 449 +++ .../armnetwork/securityrules_client.go | 31 +- .../securityrules_client_example_test.go | 168 - .../securityuserconfigurations_client.go | 25 +- ...yuserconfigurations_client_example_test.go | 168 - .../securityuserrulecollections_client.go | 25 +- ...userrulecollections_client_example_test.go | 184 - .../armnetwork/securityuserrules_client.go | 25 +- .../securityuserrules_client_example_test.go | 232 -- .../serviceassociationlinks_client.go | 9 +- ...iceassociationlinks_client_example_test.go | 54 - .../armnetwork/servicecommunity_live_test.go | 2 +- .../serviceendpointpolicies_client.go | 41 +- ...iceendpointpolicies_client_example_test.go | 397 --- .../serviceendpointpolicy_live_test.go | 2 +- ...serviceendpointpolicydefinitions_client.go | 31 +- ...ntpolicydefinitions_client_example_test.go | 157 - .../servicetaginformation_client.go | 7 +- ...rvicetaginformation_client_example_test.go | 169 - .../network/armnetwork/servicetags_client.go | 9 +- .../servicetags_client_example_test.go | 109 - .../armnetwork/servicetags_live_test.go | 2 +- .../network/armnetwork/staticcidrs_client.go | 25 +- .../staticcidrs_client_example_test.go | 174 - .../armnetwork/staticmembers_client.go | 25 +- .../staticmembers_client_example_test.go | 162 - .../network/armnetwork/subnets_client.go | 45 +- .../armnetwork/subnets_client_example_test.go | 452 --- ...riptionnetworkmanagerconnections_client.go | 25 +- ...kmanagerconnections_client_example_test.go | 164 - .../network/armnetwork/time_rfc3339.go | 6 +- .../network/armnetwork/usage_live_test.go | 2 +- .../network/armnetwork/usages_client.go | 9 +- .../armnetwork/usages_client_example_test.go | 644 ---- .../armnetwork/verifierworkspaces_client.go | 31 +- .../verifierworkspaces_client_example_test.go | 213 -- .../network/armnetwork/vipswap_client.go | 23 +- .../armnetwork/vipswap_client_example_test.go | 103 - .../virtualapplianceconnections_client.go | 31 +- ...pplianceconnections_client_example_test.go | 237 -- .../armnetwork/virtualappliances_client.go | 213 +- .../virtualappliances_client_example_test.go | 916 ----- .../virtualappliancesites_client.go | 31 +- ...rtualappliancesites_client_example_test.go | 171 - .../armnetwork/virtualapplianceskus_client.go | 15 +- ...irtualapplianceskus_client_example_test.go | 106 - .../virtualhubbgpconnection_client.go | 25 +- ...ualhubbgpconnection_client_example_test.go | 120 - .../virtualhubbgpconnections_client.go | 25 +- ...alhubbgpconnections_client_example_test.go | 206 -- .../virtualhubipconfiguration_client.go | 31 +- ...lhubipconfiguration_client_example_test.go | 154 - .../virtualhubroutetablev2s_client.go | 31 +- ...ualhubroutetablev2s_client_example_test.go | 190 -- .../network/armnetwork/virtualhubs_client.go | 65 +- .../virtualhubs_client_example_test.go | 706 ---- .../armnetwork/virtualnetwork_live_test.go | 2 +- .../virtualnetworkgateway_live_test.go | 2 +- ...virtualnetworkgatewayconnections_client.go | 91 +- ...kgatewayconnections_client_example_test.go | 689 ---- .../virtualnetworkgatewaynatrules_client.go | 31 +- ...workgatewaynatrules_client_example_test.go | 169 - .../virtualnetworkgateways_client.go | 670 +++- ...tualnetworkgateways_client_example_test.go | 1703 ---------- .../virtualnetworkpeerings_client.go | 29 +- ...tualnetworkpeerings_client_example_test.go | 950 ------ .../armnetwork/virtualnetworks_client.go | 59 +- .../virtualnetworks_client_example_test.go | 1209 ------- .../armnetwork/virtualnetworktaps_client.go | 43 +- .../virtualnetworktaps_client_example_test.go | 307 -- .../virtualrouterpeerings_client.go | 31 +- ...rtualrouterpeerings_client_example_test.go | 147 - .../armnetwork/virtualrouters_client.go | 35 +- .../virtualrouters_client_example_test.go | 246 -- .../armnetwork/virtualwan_live_test.go | 2 +- .../network/armnetwork/virtualwans_client.go | 43 +- .../virtualwans_client_example_test.go | 374 -- .../armnetwork/vpnconnections_client.go | 43 +- .../vpnconnections_client_example_test.go | 411 --- .../network/armnetwork/vpngateways_client.go | 63 +- .../vpngateways_client_example_test.go | 1334 -------- .../armnetwork/vpnlinkconnections_client.go | 51 +- .../vpnlinkconnections_client_example_test.go | 221 -- .../vpnserverconfigurations_client.go | 43 +- ...erverconfigurations_client_example_test.go | 855 ----- ...urationsassociatedwithvirtualwan_client.go | 14 +- ...iatedwithvirtualwan_client_example_test.go | 47 - .../vpnsitelinkconnections_client.go | 9 +- ...sitelinkconnections_client_example_test.go | 72 - .../network/armnetwork/vpnsitelinks_client.go | 15 +- .../vpnsitelinks_client_example_test.go | 117 - .../network/armnetwork/vpnsites_client.go | 43 +- .../vpnsites_client_example_test.go | 464 --- .../vpnsitesconfiguration_client.go | 11 +- ...nsitesconfiguration_client_example_test.go | 44 - .../network/armnetwork/watchers_client.go | 135 +- .../watchers_client_example_test.go | 933 ----- .../webapplicationfirewall_live_test.go | 2 +- .../webapplicationfirewallpolicies_client.go | 35 +- ...ionfirewallpolicies_client_example_test.go | 1383 -------- .../armnetwork/webcategories_client.go | 13 +- .../webcategories_client_example_test.go | 84 - 516 files changed, 20511 insertions(+), 62463 deletions(-) delete mode 100644 sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/nspassociationreconcile_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go create mode 100644 sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/groups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/management_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/managers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go create mode 100644 sdk/resourcemanager/network/armnetwork/nspassociationreconcile_client.go delete mode 100644 sdk/resourcemanager/network/armnetwork/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go create mode 100644 sdk/resourcemanager/network/armnetwork/responses_serde.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routes_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go create mode 100644 sdk/resourcemanager/network/armnetwork/securityperimeters_client.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go diff --git a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md index 0de615e48240..7b5e7ee24476 100644 --- a/sdk/resourcemanager/network/armnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/network/armnetwork/CHANGELOG.md @@ -1,5 +1,142 @@ # Release History +## 7.0.0 (2025-03-06) +### Breaking Changes + +- Type of `LoadBalancerHealthPerRulePerBackendAddress.NetworkInterfaceIPConfigurationID` has been changed from `*InterfaceIPConfiguration` to `*string` +- Function `*ConnectionMonitorsClient.BeginQuery` has been removed +- Function `*ConnectionMonitorsClient.BeginStart` has been removed + +### Features Added + +- New value `ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader`, `ApplicationGatewayFirewallUserSessionVariableGeoLocationXFFHeader` added to enum type `ApplicationGatewayFirewallUserSessionVariable` +- New enum type `AccessRuleDirection` with values `AccessRuleDirectionInbound`, `AccessRuleDirectionOutbound` +- New enum type `AdvertisedPublicPrefixPropertiesValidationState` with values `AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry`, `AdvertisedPublicPrefixPropertiesValidationStateConfigured`, `AdvertisedPublicPrefixPropertiesValidationStateConfiguring`, `AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding`, `AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded`, `AdvertisedPublicPrefixPropertiesValidationStateNotConfigured`, `AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateValidationFailed`, `AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded` +- New enum type `AssociationAccessMode` with values `AssociationAccessModeAudit`, `AssociationAccessModeEnforced`, `AssociationAccessModeLearning` +- New enum type `ConnectedGroupAddressOverlap` with values `ConnectedGroupAddressOverlapAllowed`, `ConnectedGroupAddressOverlapDisallowed` +- New enum type `ConnectedGroupPrivateEndpointScale` with values `ConnectedGroupPrivateEndpointScaleHighScale`, `ConnectedGroupPrivateEndpointScaleStandard` +- New enum type `NspLinkProvisioningState` with values `NspLinkProvisioningStateAccepted`, `NspLinkProvisioningStateCreating`, `NspLinkProvisioningStateDeleting`, `NspLinkProvisioningStateFailed`, `NspLinkProvisioningStateSucceeded`, `NspLinkProvisioningStateUpdating`, `NspLinkProvisioningStateWaitForRemoteCompletion` +- New enum type `NspLinkStatus` with values `NspLinkStatusApproved`, `NspLinkStatusDisconnected`, `NspLinkStatusPending`, `NspLinkStatusRejected` +- New enum type `NspProvisioningState` with values `NspProvisioningStateAccepted`, `NspProvisioningStateCreating`, `NspProvisioningStateDeleting`, `NspProvisioningStateFailed`, `NspProvisioningStateSucceeded`, `NspProvisioningStateUpdating` +- New enum type `PeeringEnforcement` with values `PeeringEnforcementEnforced`, `PeeringEnforcementUnenforced` +- New enum type `VirtualNetworkGatewayMigrationPhase` with values `VirtualNetworkGatewayMigrationPhaseAbort`, `VirtualNetworkGatewayMigrationPhaseAbortSucceeded`, `VirtualNetworkGatewayMigrationPhaseCommit`, `VirtualNetworkGatewayMigrationPhaseCommitSucceeded`, `VirtualNetworkGatewayMigrationPhaseExecute`, `VirtualNetworkGatewayMigrationPhaseExecuteSucceeded`, `VirtualNetworkGatewayMigrationPhaseNone`, `VirtualNetworkGatewayMigrationPhasePrepare`, `VirtualNetworkGatewayMigrationPhasePrepareSucceeded` +- New enum type `VirtualNetworkGatewayMigrationState` with values `VirtualNetworkGatewayMigrationStateFailed`, `VirtualNetworkGatewayMigrationStateInProgress`, `VirtualNetworkGatewayMigrationStateNone`, `VirtualNetworkGatewayMigrationStateSucceeded` +- New enum type `VirtualNetworkGatewayMigrationType` with values `VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP` +- New function `*ClientFactory.NewNspAssociationReconcileClient() *NspAssociationReconcileClient` +- New function `*ClientFactory.NewSecurityPerimeterAccessRulesClient() *SecurityPerimeterAccessRulesClient` +- New function `*ClientFactory.NewSecurityPerimeterAssociableResourceTypesClient() *SecurityPerimeterAssociableResourceTypesClient` +- New function `*ClientFactory.NewSecurityPerimeterAssociationsClient() *SecurityPerimeterAssociationsClient` +- New function `*ClientFactory.NewSecurityPerimeterLinkReferencesClient() *SecurityPerimeterLinkReferencesClient` +- New function `*ClientFactory.NewSecurityPerimeterLinksClient() *SecurityPerimeterLinksClient` +- New function `*ClientFactory.NewSecurityPerimeterLoggingConfigurationsClient() *SecurityPerimeterLoggingConfigurationsClient` +- New function `*ClientFactory.NewSecurityPerimeterOperationStatusesClient() *SecurityPerimeterOperationStatusesClient` +- New function `*ClientFactory.NewSecurityPerimeterProfilesClient() *SecurityPerimeterProfilesClient` +- New function `*ClientFactory.NewSecurityPerimetersClient() *SecurityPerimetersClient` +- New function `NewSecurityPerimeterAccessRulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterAccessRulesClient, error)` +- New function `*SecurityPerimeterAccessRulesClient.CreateOrUpdate(context.Context, string, string, string, string, NspAccessRule, *SecurityPerimeterAccessRulesClientCreateOrUpdateOptions) (SecurityPerimeterAccessRulesClientCreateOrUpdateResponse, error)` +- New function `*SecurityPerimeterAccessRulesClient.Delete(context.Context, string, string, string, string, *SecurityPerimeterAccessRulesClientDeleteOptions) (SecurityPerimeterAccessRulesClientDeleteResponse, error)` +- New function `*SecurityPerimeterAccessRulesClient.Get(context.Context, string, string, string, string, *SecurityPerimeterAccessRulesClientGetOptions) (SecurityPerimeterAccessRulesClientGetResponse, error)` +- New function `*SecurityPerimeterAccessRulesClient.NewListPager(string, string, string, *SecurityPerimeterAccessRulesClientListOptions) *runtime.Pager[SecurityPerimeterAccessRulesClientListResponse]` +- New function `*SecurityPerimeterAccessRulesClient.Reconcile(context.Context, string, string, string, string, any, *SecurityPerimeterAccessRulesClientReconcileOptions) (SecurityPerimeterAccessRulesClientReconcileResponse, error)` +- New function `NewSecurityPerimeterAssociableResourceTypesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterAssociableResourceTypesClient, error)` +- New function `*SecurityPerimeterAssociableResourceTypesClient.NewListPager(string, *SecurityPerimeterAssociableResourceTypesClientListOptions) *runtime.Pager[SecurityPerimeterAssociableResourceTypesClientListResponse]` +- New function `NewSecurityPerimeterAssociationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterAssociationsClient, error)` +- New function `*SecurityPerimeterAssociationsClient.BeginCreateOrUpdate(context.Context, string, string, string, NspAssociation, *SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityPerimeterAssociationsClientCreateOrUpdateResponse], error)` +- New function `*SecurityPerimeterAssociationsClient.BeginDelete(context.Context, string, string, string, *SecurityPerimeterAssociationsClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterAssociationsClientDeleteResponse], error)` +- New function `*SecurityPerimeterAssociationsClient.Get(context.Context, string, string, string, *SecurityPerimeterAssociationsClientGetOptions) (SecurityPerimeterAssociationsClientGetResponse, error)` +- New function `*SecurityPerimeterAssociationsClient.NewListPager(string, string, *SecurityPerimeterAssociationsClientListOptions) *runtime.Pager[SecurityPerimeterAssociationsClientListResponse]` +- New function `NewSecurityPerimeterLinkReferencesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterLinkReferencesClient, error)` +- New function `*SecurityPerimeterLinkReferencesClient.BeginDelete(context.Context, string, string, string, *SecurityPerimeterLinkReferencesClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterLinkReferencesClientDeleteResponse], error)` +- New function `*SecurityPerimeterLinkReferencesClient.Get(context.Context, string, string, string, *SecurityPerimeterLinkReferencesClientGetOptions) (SecurityPerimeterLinkReferencesClientGetResponse, error)` +- New function `*SecurityPerimeterLinkReferencesClient.NewListPager(string, string, *SecurityPerimeterLinkReferencesClientListOptions) *runtime.Pager[SecurityPerimeterLinkReferencesClientListResponse]` +- New function `NewSecurityPerimeterLinksClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterLinksClient, error)` +- New function `*SecurityPerimeterLinksClient.CreateOrUpdate(context.Context, string, string, string, NspLink, *SecurityPerimeterLinksClientCreateOrUpdateOptions) (SecurityPerimeterLinksClientCreateOrUpdateResponse, error)` +- New function `*SecurityPerimeterLinksClient.BeginDelete(context.Context, string, string, string, *SecurityPerimeterLinksClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterLinksClientDeleteResponse], error)` +- New function `*SecurityPerimeterLinksClient.Get(context.Context, string, string, string, *SecurityPerimeterLinksClientGetOptions) (SecurityPerimeterLinksClientGetResponse, error)` +- New function `*SecurityPerimeterLinksClient.NewListPager(string, string, *SecurityPerimeterLinksClientListOptions) *runtime.Pager[SecurityPerimeterLinksClientListResponse]` +- New function `NewSecurityPerimeterLoggingConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterLoggingConfigurationsClient, error)` +- New function `*SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate(context.Context, string, string, string, NspLoggingConfiguration, *SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions) (SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse, error)` +- New function `*SecurityPerimeterLoggingConfigurationsClient.Delete(context.Context, string, string, string, *SecurityPerimeterLoggingConfigurationsClientDeleteOptions) (SecurityPerimeterLoggingConfigurationsClientDeleteResponse, error)` +- New function `*SecurityPerimeterLoggingConfigurationsClient.Get(context.Context, string, string, string, *SecurityPerimeterLoggingConfigurationsClientGetOptions) (SecurityPerimeterLoggingConfigurationsClientGetResponse, error)` +- New function `*SecurityPerimeterLoggingConfigurationsClient.NewListPager(string, string, *SecurityPerimeterLoggingConfigurationsClientListOptions) *runtime.Pager[SecurityPerimeterLoggingConfigurationsClientListResponse]` +- New function `NewSecurityPerimeterOperationStatusesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterOperationStatusesClient, error)` +- New function `*SecurityPerimeterOperationStatusesClient.Get(context.Context, string, string, *SecurityPerimeterOperationStatusesClientGetOptions) (SecurityPerimeterOperationStatusesClientGetResponse, error)` +- New function `NewSecurityPerimeterProfilesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimeterProfilesClient, error)` +- New function `*SecurityPerimeterProfilesClient.CreateOrUpdate(context.Context, string, string, string, NspProfile, *SecurityPerimeterProfilesClientCreateOrUpdateOptions) (SecurityPerimeterProfilesClientCreateOrUpdateResponse, error)` +- New function `*SecurityPerimeterProfilesClient.Delete(context.Context, string, string, string, *SecurityPerimeterProfilesClientDeleteOptions) (SecurityPerimeterProfilesClientDeleteResponse, error)` +- New function `*SecurityPerimeterProfilesClient.Get(context.Context, string, string, string, *SecurityPerimeterProfilesClientGetOptions) (SecurityPerimeterProfilesClientGetResponse, error)` +- New function `*SecurityPerimeterProfilesClient.NewListPager(string, string, *SecurityPerimeterProfilesClientListOptions) *runtime.Pager[SecurityPerimeterProfilesClientListResponse]` +- New function `NewSecurityPerimetersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SecurityPerimetersClient, error)` +- New function `*SecurityPerimetersClient.CreateOrUpdate(context.Context, string, string, SecurityPerimeter, *SecurityPerimetersClientCreateOrUpdateOptions) (SecurityPerimetersClientCreateOrUpdateResponse, error)` +- New function `*SecurityPerimetersClient.BeginDelete(context.Context, string, string, *SecurityPerimetersClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimetersClientDeleteResponse], error)` +- New function `*SecurityPerimetersClient.Get(context.Context, string, string, *SecurityPerimetersClientGetOptions) (SecurityPerimetersClientGetResponse, error)` +- New function `*SecurityPerimetersClient.NewListBySubscriptionPager(*SecurityPerimetersClientListBySubscriptionOptions) *runtime.Pager[SecurityPerimetersClientListBySubscriptionResponse]` +- New function `*SecurityPerimetersClient.NewListPager(string, *SecurityPerimetersClientListOptions) *runtime.Pager[SecurityPerimetersClientListResponse]` +- New function `*SecurityPerimetersClient.Patch(context.Context, string, string, UpdateTagsRequest, *SecurityPerimetersClientPatchOptions) (SecurityPerimetersClientPatchResponse, error)` +- New function `*VirtualAppliancesClient.BeginGetBootDiagnosticLogs(context.Context, string, string, VirtualApplianceBootDiagnosticParameters, *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*runtime.Poller[VirtualAppliancesClientGetBootDiagnosticLogsResponse], error)` +- New function `*VirtualAppliancesClient.BeginReimage(context.Context, string, string, *VirtualAppliancesClientBeginReimageOptions) (*runtime.Poller[VirtualAppliancesClientReimageResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginGetResiliencyInformation(context.Context, string, string, *VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetResiliencyInformationResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginGetRoutesInformation(context.Context, string, string, *VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetRoutesInformationResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginInvokeAbortMigration(context.Context, string, string, *VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeAbortMigrationResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginInvokeCommitMigration(context.Context, string, string, *VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeCommitMigrationResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration(context.Context, string, string, *VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse], error)` +- New function `*VirtualNetworkGatewaysClient.BeginInvokePrepareMigration(context.Context, string, string, VirtualNetworkGatewayMigrationParameters, *VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokePrepareMigrationResponse], error)` +- New function `NewNspAssociationReconcileClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NspAssociationReconcileClient, error)` +- New function `*NspAssociationReconcileClient.Post(context.Context, string, string, string, any, *NspAssociationReconcileClientPostOptions) (NspAssociationReconcileClientPostResponse, error)` +- New struct `AdvertisedPublicPrefixProperties` +- New struct `CircuitMetadataMap` +- New struct `ConnectivityConfigurationPropertiesConnectivityCapabilities` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `GatewayResiliencyInformation` +- New struct `GatewayResiliencyRecommendation` +- New struct `GatewayRouteSet` +- New struct `GatewayRouteSetsInformation` +- New struct `ManagedRuleSetRuleGroup` +- New struct `NspAccessRule` +- New struct `NspAccessRuleListResult` +- New struct `NspAccessRuleProperties` +- New struct `NspAssociation` +- New struct `NspAssociationProperties` +- New struct `NspAssociationsListResult` +- New struct `NspLink` +- New struct `NspLinkListResult` +- New struct `NspLinkProperties` +- New struct `NspLinkReference` +- New struct `NspLinkReferenceListResult` +- New struct `NspLinkReferenceProperties` +- New struct `NspLoggingConfiguration` +- New struct `NspLoggingConfigurationListResult` +- New struct `NspLoggingConfigurationProperties` +- New struct `NspProfile` +- New struct `NspProfileListResult` +- New struct `NspProfileProperties` +- New struct `OperationStatusResult` +- New struct `PerimeterAssociableResource` +- New struct `PerimeterAssociableResourceProperties` +- New struct `PerimeterAssociableResourcesListResult` +- New struct `PerimeterBasedAccessRule` +- New struct `ProxyResource` +- New struct `ResiliencyRecommendationComponents` +- New struct `RouteSourceDetails` +- New struct `SecurityPerimeter` +- New struct `SecurityPerimeterListResult` +- New struct `SecurityPerimeterProperties` +- New struct `SubscriptionID` +- New struct `UpdateTagsRequest` +- New struct `VirtualApplianceBootDiagnosticParameters` +- New struct `VirtualApplianceInstanceID` +- New struct `VirtualNetworkGatewayMigrationParameters` +- New struct `VirtualNetworkGatewayMigrationStatus` +- New field `ConnectivityCapabilities` in struct `ConnectivityConfigurationProperties` +- New field `AdvertisedPublicPrefixInfo` in struct `ExpressRouteCircuitPeeringConfig` +- New field `Etag` in struct `IpamPool` +- New field `EnableConnectionTracking` in struct `LoadBalancingRulePropertiesFormat` +- New field `ComputedDisabledRules` in struct `ManagedRuleSet` +- New field `Etag` in struct `VerifierWorkspace` +- New field `EnableHighBandwidthVPNGateway`, `VirtualNetworkGatewayMigrationStatus` in struct `VirtualNetworkGatewayPropertiesFormat` + + ## 6.2.0 (2024-12-09) ### Features Added diff --git a/sdk/resourcemanager/network/armnetwork/README.md b/sdk/resourcemanager/network/armnetwork/README.md index c4348574780b..cbd79dcf92c1 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/v6 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7 ``` ## Authorization diff --git a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go index 9a4c50e8871c..a2f15d9f10a8 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrulecollections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -79,7 +76,7 @@ func (client *AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, re } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, options *AdminRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection AdminRuleCollection, _ *AdminRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *AdminRuleCollectionsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleCollection); err != nil { @@ -127,7 +124,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +202,7 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +214,7 @@ func (client *AdminRuleCollectionsClient) deleteCreateRequest(ctx context.Contex // Get - Gets a network manager security admin configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -247,7 +244,7 @@ func (client *AdminRuleCollectionsClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *AdminRuleCollectionsClientGetOptions) (*policy.Request, error) { +func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, _ *AdminRuleCollectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -274,7 +271,7 @@ func (client *AdminRuleCollectionsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +288,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -350,7 +347,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 0d64c1947916..000000000000 --- a/sdk/resourcemanager/network/armnetwork/adminrulecollections_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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("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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/adminrules_client.go b/sdk/resourcemanager/network/armnetwork/adminrules_client.go index e6787b35aef1..69d1429f299d 100644 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/adminrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -80,7 +77,7 @@ func (client *AdminRulesClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, options *AdminRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, adminRule BaseAdminRuleClassification, _ *AdminRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -111,7 +108,7 @@ func (client *AdminRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, adminRule); err != nil { @@ -132,7 +129,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -214,7 +211,7 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -226,7 +223,7 @@ func (client *AdminRulesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a network manager security configuration admin rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -256,7 +253,7 @@ func (client *AdminRulesClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *AdminRulesClientGetOptions) (*policy.Request, error) { +func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, _ *AdminRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -287,7 +284,7 @@ func (client *AdminRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +301,7 @@ func (client *AdminRulesClient) getHandleResponse(resp *http.Response) (AdminRul // NewListPager - List all network manager security configuration admin rules. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -367,7 +364,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 27e5eadfd7cc..000000000000 --- a/sdk/resourcemanager/network/armnetwork/adminrules_client_example_test.go +++ /dev/null @@ -1,389 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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("*"), - // AddressPrefixType: to.Ptr(armnetwork.AddressPrefixTypeIPPrefix), - // }}, - // Protocol: to.Ptr(armnetwork.SecurityConfigurationRuleProtocolTCP), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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("/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")}, - 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.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 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // 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), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - 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/applicationgatewayprivateendpointconnections_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go index 08621ae7cea9..0076181727b8 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -20,7 +17,8 @@ import ( "strings" ) -// ApplicationGatewayPrivateEndpointConnectionsClient contains the methods for the ApplicationGatewayPrivateEndpointConnections group. +// ApplicationGatewayPrivateEndpointConnectionsClient contains the methods for the ApplicationGatewayPrivateEndpointConnections +// group. // Don't use this type directly, use NewApplicationGatewayPrivateEndpointConnectionsClient() instead. type ApplicationGatewayPrivateEndpointConnectionsClient struct { internal *arm.Client @@ -47,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -74,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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,7 +95,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteOperatio } // deleteCreateRequest creates the Delete request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -120,7 +118,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,7 +127,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) deleteCreateRe // Get - Gets the specified private endpoint connection on application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -158,7 +156,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx contex } // getCreateRequest creates the Get request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, options *ApplicationGatewayPrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -181,7 +179,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +196,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) getHandleRespo // NewListPager - Lists all private endpoint connections on an application gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager @@ -227,7 +225,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) NewListPager(r } // listCreateRequest creates the List request. -func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -246,7 +244,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) listCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +262,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - connectionName - The name of the application gateway private endpoint connection. @@ -292,7 +290,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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,7 +313,7 @@ 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, options *ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -338,7 +336,7 @@ func (client *ApplicationGatewayPrivateEndpointConnectionsClient) updateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go deleted file mode 100644 index 66a74192fc6d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "appgw", "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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().Get(ctx, "rg1", "appgw", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayPrivateEndpointConnectionsClient().NewListPager("rg1", "appgw", 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.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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go index bffc0442fa3a..8b3e89e86d0b 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string, cred // NewListPager - Lists all private link resources on an application gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewayPrivateLinkResourcesClientListOptions contains the optional parameters for the ApplicationGatewayPrivateLinkResourcesClient.NewListPager @@ -75,7 +72,7 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) NewListPager(resourc } // listCreateRequest creates the List request. -func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewayPrivateLinkResourcesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *ApplicationGatewayPrivateLinkResourcesClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 8b78ca10d521..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewayprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayPrivateLinkResourcesClient().NewListPager("rg1", "appgw", 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.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")}, - // RequiredZoneNames: []*string{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go index 0ccdcae68368..55344aeec678 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginBackendHealthOptions contains the optional parameters for the ApplicationGatewaysClient.BeginBackendHealth @@ -73,7 +70,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) backendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginBackendHealthOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginBackendHealth" @@ -118,7 +115,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +125,7 @@ func (client *ApplicationGatewaysClient) backendHealthCreateRequest(ctx context. // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - probeRequest - Request body for on-demand test probe operation. @@ -156,7 +153,7 @@ func (client *ApplicationGatewaysClient) BeginBackendHealthOnDemand(ctx context. // application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -201,7 +198,7 @@ func (client *ApplicationGatewaysClient) backendHealthOnDemandCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, probeRequest); err != nil { @@ -213,7 +210,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to the create or update application gateway operation. @@ -240,7 +237,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -263,7 +260,7 @@ 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, options *ApplicationGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -282,7 +279,7 @@ func (client *ApplicationGatewaysClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -294,7 +291,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete @@ -320,7 +317,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginDelete" @@ -343,7 +340,7 @@ func (client *ApplicationGatewaysClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -362,7 +359,7 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +368,7 @@ func (client *ApplicationGatewaysClient) deleteCreateRequest(ctx context.Context // Get - Gets the specified application gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientGetOptions contains the optional parameters for the ApplicationGatewaysClient.Get method. @@ -398,7 +395,7 @@ func (client *ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -417,7 +414,7 @@ func (client *ApplicationGatewaysClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +432,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 2024-05-01 +// Generated from API version 2024-07-01 // - predefinedPolicyName - Name of Ssl predefined policy. // - options - ApplicationGatewaysClientGetSSLPredefinedPolicyOptions contains the optional parameters for the ApplicationGatewaysClient.GetSSLPredefinedPolicy // method. @@ -462,7 +459,7 @@ func (client *ApplicationGatewaysClient) GetSSLPredefinedPolicy(ctx context.Cont } // getSSLPredefinedPolicyCreateRequest creates the GetSSLPredefinedPolicy request. -func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx context.Context, predefinedPolicyName string, options *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx context.Context, predefinedPolicyName string, _ *ApplicationGatewaysClientGetSSLPredefinedPolicyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -477,7 +474,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,7 +491,7 @@ func (client *ApplicationGatewaysClient) getSSLPredefinedPolicyHandleResponse(re // NewListPager - Lists all application gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationGatewaysClientListOptions contains the optional parameters for the ApplicationGatewaysClient.NewListPager // method. @@ -522,7 +519,7 @@ func (client *ApplicationGatewaysClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationGatewaysClientListOptions) (*policy.Request, error) { +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") @@ -537,7 +534,7 @@ func (client *ApplicationGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -554,7 +551,7 @@ func (client *ApplicationGatewaysClient) listHandleResponse(resp *http.Response) // NewListAllPager - Gets all the application gateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAllOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAllPager // method. func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGatewaysClientListAllOptions) *runtime.Pager[ApplicationGatewaysClientListAllResponse] { @@ -581,7 +578,7 @@ func (client *ApplicationGatewaysClient) NewListAllPager(options *ApplicationGat } // listAllCreateRequest creates the ListAll request. -func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAllOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -592,7 +589,7 @@ func (client *ApplicationGatewaysClient) listAllCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -610,7 +607,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableRequestHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableRequestHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (ApplicationGatewaysClientListAvailableRequestHeadersResponse, error) { @@ -636,7 +633,7 @@ func (client *ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context } // listAvailableRequestHeadersCreateRequest creates the ListAvailableRequestHeaders request. -func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableRequestHeadersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -647,7 +644,7 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -665,7 +662,7 @@ func (client *ApplicationGatewaysClient) listAvailableRequestHeadersHandleRespon // ListAvailableResponseHeaders - Lists all available response headers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableResponseHeadersOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableResponseHeaders // method. func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (ApplicationGatewaysClientListAvailableResponseHeadersResponse, error) { @@ -691,7 +688,7 @@ func (client *ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx contex } // listAvailableResponseHeadersCreateRequest creates the ListAvailableResponseHeaders request. -func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableResponseHeadersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -702,7 +699,7 @@ func (client *ApplicationGatewaysClient) listAvailableResponseHeadersCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -720,7 +717,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableSSLOptionsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableSSLOptions // method. func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (ApplicationGatewaysClientListAvailableSSLOptionsResponse, error) { @@ -746,7 +743,7 @@ func (client *ApplicationGatewaysClient) ListAvailableSSLOptions(ctx context.Con } // listAvailableSSLOptionsCreateRequest creates the ListAvailableSSLOptions request. -func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableSSLOptionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -757,7 +754,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -774,7 +771,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLOptionsHandleResponse(r // NewListAvailableSSLPredefinedPoliciesPager - Lists all SSL predefined policies for configuring Ssl policy. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions contains the optional parameters for the ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager // method. func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPager(options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) *runtime.Pager[ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesResponse] { @@ -801,7 +798,7 @@ func (client *ApplicationGatewaysClient) NewListAvailableSSLPredefinedPoliciesPa } // listAvailableSSLPredefinedPoliciesCreateRequest creates the ListAvailableSSLPredefinedPolicies request. -func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableSSLPredefinedPoliciesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -812,7 +809,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -830,7 +827,7 @@ func (client *ApplicationGatewaysClient) listAvailableSSLPredefinedPoliciesHandl // ListAvailableServerVariables - Lists all available server variables. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableServerVariablesOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableServerVariables // method. func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (ApplicationGatewaysClientListAvailableServerVariablesResponse, error) { @@ -856,7 +853,7 @@ func (client *ApplicationGatewaysClient) ListAvailableServerVariables(ctx contex } // listAvailableServerVariablesCreateRequest creates the ListAvailableServerVariables request. -func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableServerVariablesOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableServerVariablesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -867,7 +864,7 @@ func (client *ApplicationGatewaysClient) listAvailableServerVariablesCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -885,7 +882,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationGatewaysClientListAvailableWafRuleSetsOptions contains the optional parameters for the ApplicationGatewaysClient.ListAvailableWafRuleSets // method. func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (ApplicationGatewaysClientListAvailableWafRuleSetsResponse, error) { @@ -911,7 +908,7 @@ func (client *ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Co } // listAvailableWafRuleSetsCreateRequest creates the ListAvailableWafRuleSets request. -func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(ctx context.Context, options *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (*policy.Request, error) { +func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(ctx context.Context, _ *ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -922,7 +919,7 @@ func (client *ApplicationGatewaysClient) listAvailableWafRuleSetsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -940,7 +937,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart @@ -966,7 +963,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStart" @@ -989,7 +986,7 @@ func (client *ApplicationGatewaysClient) start(ctx context.Context, resourceGrou } // startCreateRequest creates the Start request. -func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStartOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1008,7 +1005,7 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1017,7 +1014,7 @@ func (client *ApplicationGatewaysClient) startCreateRequest(ctx context.Context, // BeginStop - Stops the specified application gateway in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - options - ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop @@ -1043,7 +1040,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ApplicationGatewaysClient.BeginStop" @@ -1066,7 +1063,7 @@ func (client *ApplicationGatewaysClient) stop(ctx context.Context, resourceGroup } // stopCreateRequest creates the Stop request. -func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *ApplicationGatewaysClientBeginStopOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1085,7 +1082,7 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1094,7 +1091,7 @@ func (client *ApplicationGatewaysClient) stopCreateRequest(ctx context.Context, // UpdateTags - Updates the specified application gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationGatewayName - The name of the application gateway. // - parameters - Parameters supplied to update application gateway tags. @@ -1123,7 +1120,7 @@ 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, options *ApplicationGatewaysClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1142,7 +1139,7 @@ func (client *ApplicationGatewaysClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go deleted file mode 100644 index 7ca4f02377d0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgateways_client_example_test.go +++ /dev/null @@ -1,2346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationGatewaysClient().BeginDelete(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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // 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), - // }, - // }}, - // 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), - // }, - // }}, - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // }, - // }}, - // 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"), - // }, - // }, - // }, - // { - // 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{ - // 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{ - // 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{ - // { - // 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{ - // { - // 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), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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": {}, - }, - }, - Properties: &armnetwork.ApplicationGatewayPropertiesFormat{ - BackendAddressPools: []*armnetwork.ApplicationGatewayBackendAddressPool{ - { - Name: to.Ptr("appgwpool"), - Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - { - IPAddress: to.Ptr("10.0.1.1"), - }, - { - 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"), - Properties: &armnetwork.ApplicationGatewayBackendAddressPoolPropertiesFormat{ - BackendAddresses: []*armnetwork.ApplicationGatewayBackendAddress{ - { - IPAddress: to.Ptr("10.0.0.1"), - }, - { - IPAddress: to.Ptr("10.0.0.2"), - }}, - }, - }}, - BackendHTTPSettingsCollection: []*armnetwork.ApplicationGatewayBackendHTTPSettings{ - { - Name: to.Ptr("appgwbhs"), - Properties: &armnetwork.ApplicationGatewayBackendHTTPSettingsPropertiesFormat{ - CookieBasedAffinity: to.Ptr(armnetwork.ApplicationGatewayCookieBasedAffinityDisabled), - Port: to.Ptr[int32](80), - RequestTimeout: to.Ptr[int32](30), - Protocol: to.Ptr(armnetwork.ApplicationGatewayProtocolHTTP), - }, - }}, - 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"), - }, - }, - }}, - FrontendPorts: []*armnetwork.ApplicationGatewayFrontendPort{ - { - Name: to.Ptr("appgwfp"), - Properties: &armnetwork.ApplicationGatewayFrontendPortPropertiesFormat{ - Port: to.Ptr[int32](443), - }, - }, - { - Name: to.Ptr("appgwfp80"), - 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"), - }, - }, - }}, - GlobalConfiguration: &armnetwork.ApplicationGatewayGlobalConfiguration{ - EnableRequestBuffering: to.Ptr(true), - EnableResponseBuffering: to.Ptr(true), - }, - HTTPListeners: []*armnetwork.ApplicationGatewayHTTPListener{ - { - 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"), - }, - 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), - }, - }, - { - 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"), - }, - 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"), - }, - 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"), - }, - Priority: to.Ptr[int32](10), - RewriteRuleSet: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1"), - }, - RuleType: to.Ptr(armnetwork.ApplicationGatewayRequestRoutingRuleTypeBasic), - }, - }}, - RewriteRuleSets: []*armnetwork.ApplicationGatewayRewriteRuleSet{ - { - Name: to.Ptr("rewriteRuleSet1"), - Properties: &armnetwork.ApplicationGatewayRewriteRuleSetPropertiesFormat{ - 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_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"), - }, - }, - 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.ApplicationGatewaySKUNameStandardV2), - Capacity: to.Ptr[int32](3), - Tier: to.Ptr(armnetwork.ApplicationGatewayTierStandardV2), - }, - SSLCertificates: []*armnetwork.ApplicationGatewaySSLCertificate{ - { - Name: to.Ptr("sslcert"), - Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - Data: to.Ptr("****"), - Password: to.Ptr("****"), - }, - }, - { - Name: to.Ptr("sslcert2"), - Properties: &armnetwork.ApplicationGatewaySSLCertificatePropertiesFormat{ - KeyVaultSecretID: to.Ptr("https://kv/secret"), - }, - }}, - SSLProfiles: []*armnetwork.ApplicationGatewaySSLProfile{ - { - Name: to.Ptr("sslProfile1"), - Properties: &armnetwork.ApplicationGatewaySSLProfilePropertiesFormat{ - ClientAuthConfiguration: &armnetwork.ApplicationGatewayClientAuthConfiguration{ - VerifyClientCertIssuerDN: to.Ptr(true), - }, - 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{ - { - Name: to.Ptr("clientcert"), - Properties: &armnetwork.ApplicationGatewayTrustedClientCertificatePropertiesFormat{ - Data: to.Ptr("****"), - }, - }}, - TrustedRootCertificates: []*armnetwork.ApplicationGatewayTrustedRootCertificate{ - { - Name: to.Ptr("rootcert"), - Properties: &armnetwork.ApplicationGatewayTrustedRootCertificatePropertiesFormat{ - Data: to.Ptr("****"), - }, - }, - { - Name: to.Ptr("rootcert1"), - Properties: &armnetwork.ApplicationGatewayTrustedRootCertificatePropertiesFormat{ - KeyVaultSecretID: to.Ptr("https://kv/secret"), - }, - }}, - }, - }, nil) - if 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.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), - // }, - // }, - // { - // 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"), - // }, - // { - // 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), - // }, - // }}, - // 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), - // }, - // }}, - // 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"), - // }, - // 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"), - // }, - // 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), - // }, - // }}, - // 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"), - // }, - // }, - // 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), - // }, - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"), - // Name: to.Ptr("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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // { - // IPAddress: to.Ptr("10.10.10.2"), - // }, - // { - // IPAddress: to.Ptr("10.10.10.3"), - // }}, - // 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), - // }, - // }}, - // 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"), - // }, - // }, - // }}, - // 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), - // }, - // }}, - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // FrontendPort: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/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{ - // { - // 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"), - // }, - // BackendHTTPSettings: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/AppGw/backendHttpSettingsCollection/PoolSetting01"), - // }, - // HTTPListener: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().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.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), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // 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), - // }, - // }}, - // 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), - // }, - // }}, - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // }, - // }}, - // 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"), - // }, - // }, - // }, - // { - // 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{ - // 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{ - // 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{ - // { - // 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{ - // { - // 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), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().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.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), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1"), - // Name: to.Ptr("appgwpool1"), - // 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), - // }, - // }}, - // 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), - // }, - // }}, - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // }, - // }}, - // 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"), - // }, - // }, - // }, - // { - // 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{ - // 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{ - // 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{ - // { - // 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{ - // { - // 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), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableRequestHeaders(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.StringArray = []*string{ - // to.Ptr("Accept-Charset")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableResponseHeaders(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.StringArray = []*string{ - // to.Ptr("Access-Control-Allow-Origin")} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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("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: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewaysClient().ListAvailableSSLOptions(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.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)}, - // 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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewaysClient().NewListAvailableSSLPredefinedPoliciesPager(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.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)}, - // MinProtocolVersion: to.Ptr(armnetwork.ApplicationGatewaySSLProtocolTLSv10), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups//providers/Microsoft.Network/ApplicationGatewayAvailableSslOptions/default/ApplicationGatewaySslPredefinedPolicy/AppGwSslPolicy20170401"), - // Name: to.Ptr("AppGwSslPolicy20170401"), - // 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.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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go index 45d3570b7765..1d2aa9a14796 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string, crede // NewGetPager - Gets the regional application gateway waf manifest. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The region where the nrp are located at. // - options - ApplicationGatewayWafDynamicManifestsClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsClient.NewGetPager // method. @@ -74,7 +71,7 @@ func (client *ApplicationGatewayWafDynamicManifestsClient) NewGetPager(location } // getCreateRequest creates the Get request. -func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsClientGetOptions) (*policy.Request, error) { +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") @@ -89,7 +86,7 @@ func (client *ApplicationGatewayWafDynamicManifestsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 81c80063cf70..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_client_example_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationGatewayWafDynamicManifestsClient().NewGetPager("westus", 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.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), - // }, - // { - // 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)}, - // }}, - // 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 1bf432ecacea..fc3f8b799f16 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifests_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go index b5acb3421f1b..596f51f172c6 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -20,7 +17,8 @@ import ( "strings" ) -// ApplicationGatewayWafDynamicManifestsDefaultClient contains the methods for the ApplicationGatewayWafDynamicManifestsDefault group. +// ApplicationGatewayWafDynamicManifestsDefaultClient contains the methods for the ApplicationGatewayWafDynamicManifestsDefault +// group. // Don't use this type directly, use NewApplicationGatewayWafDynamicManifestsDefaultClient() instead. type ApplicationGatewayWafDynamicManifestsDefaultClient struct { internal *arm.Client @@ -47,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The region where the nrp are located at. // - options - ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions contains the optional parameters for the ApplicationGatewayWafDynamicManifestsDefaultClient.Get // method. @@ -74,7 +72,7 @@ func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx contex } // getCreateRequest creates the Get request. -func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getCreateRequest(ctx context.Context, location string, options *ApplicationGatewayWafDynamicManifestsDefaultClientGetOptions) (*policy.Request, error) { +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") @@ -89,7 +87,7 @@ func (client *ApplicationGatewayWafDynamicManifestsDefaultClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index c477d8e01c27..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationgatewaywafdynamicmanifestsdefault_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationGatewayWafDynamicManifestsDefaultClient().Get(ctx, "westus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // { - // 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)}, - // }}, - // 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 e85f405113e6..a1ec8d525dcb 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroup_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go index d11fe3c1e3b3..d9de3e43925e 100644 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to the create or update ApplicationSecurityGroup operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *ApplicationSecurityGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationSecurityGroupsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *ApplicationSecurityGroupsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *ApplicationSecurityGroupsClient) deleteCreateRequest(ctx context.C // Get - Gets information about the specified application security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - options - ApplicationSecurityGroupsClientGetOptions contains the optional parameters for the ApplicationSecurityGroupsClient.Get @@ -233,7 +230,7 @@ func (client *ApplicationSecurityGroupsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, options *ApplicationSecurityGroupsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *ApplicationSecurityGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *ApplicationSecurityGroupsClient) getHandleResponse(resp *http.Resp // NewListPager - Gets all the application security groups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ApplicationSecurityGroupsClientListOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListPager // method. @@ -297,7 +294,7 @@ func (client *ApplicationSecurityGroupsClient) NewListPager(resourceGroupName st } // listCreateRequest creates the List request. -func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ApplicationSecurityGroupsClientListOptions) (*policy.Request, error) { +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") @@ -312,7 +309,7 @@ func (client *ApplicationSecurityGroupsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +326,7 @@ func (client *ApplicationSecurityGroupsClient) listHandleResponse(resp *http.Res // NewListAllPager - Gets all application security groups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ApplicationSecurityGroupsClientListAllOptions contains the optional parameters for the ApplicationSecurityGroupsClient.NewListAllPager // method. func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *ApplicationSecurityGroupsClientListAllOptions) *runtime.Pager[ApplicationSecurityGroupsClientListAllResponse] { @@ -356,7 +353,7 @@ func (client *ApplicationSecurityGroupsClient) NewListAllPager(options *Applicat } // listAllCreateRequest creates the ListAll request. -func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *ApplicationSecurityGroupsClientListAllOptions) (*policy.Request, error) { +func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context.Context, _ *ApplicationSecurityGroupsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +364,7 @@ func (client *ApplicationSecurityGroupsClient) listAllCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - applicationSecurityGroupName - The name of the application security group. // - parameters - Parameters supplied to update application security group tags. @@ -414,7 +411,7 @@ 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, options *ApplicationSecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -433,7 +430,7 @@ func (client *ApplicationSecurityGroupsClient) updateTagsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go deleted file mode 100644 index d799432e2ea7..000000000000 --- a/sdk/resourcemanager/network/armnetwork/applicationsecuritygroups_client_example_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationSecurityGroupsClient().BeginDelete(ctx, "rg1", "test-asg", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationSecurityGroupsClient().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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationSecurityGroupsClient().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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/autorest.md b/sdk/resourcemanager/network/armnetwork/autorest.md index 05ed14d22535..420d23734898 100644 --- a/sdk/resourcemanager/network/armnetwork/autorest.md +++ b/sdk/resourcemanager/network/armnetwork/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/network/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/network/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 6.2.0 -tag: package-2024-05 +module-version: 7.0.0 ``` diff --git a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go index ba70192e252c..0d6d12924181 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the subnet. // - options - AvailableDelegationsClientListOptions contains the optional parameters for the AvailableDelegationsClient.NewListPager // method. @@ -74,7 +71,7 @@ func (client *AvailableDelegationsClient) NewListPager(location string, options } // listCreateRequest creates the List request. -func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, location string, options *AvailableDelegationsClientListOptions) (*policy.Request, error) { +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") @@ -89,7 +86,7 @@ func (client *AvailableDelegationsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 4db270f699e1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableDelegationsClient().NewListPager("westcentralus", 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.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"), - // 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 1fab20deb4cd..c96b59155c67 100644 --- a/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availabledelegations_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go index c133087e0b4e..3b83a0d4582f 100644 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableendpointservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailableEndpointServicesClient(subscriptionID string, credential azcore // NewListPager - List what values of endpoint services are available for use. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location to check available endpoint services. // - options - AvailableEndpointServicesClientListOptions contains the optional parameters for the AvailableEndpointServicesClient.NewListPager // method. @@ -74,7 +71,7 @@ func (client *AvailableEndpointServicesClient) NewListPager(location string, opt } // listCreateRequest creates the List request. -func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Context, location string, options *AvailableEndpointServicesClientListOptions) (*policy.Request, error) { +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") @@ -89,7 +86,7 @@ func (client *AvailableEndpointServicesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index b0618df006ae..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableendpointservices_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableEndpointServicesClient().NewListPager("westus", 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.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"), - // }, - // { - // 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 1a9771dad0e2..30710c755663 100644 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - options - AvailablePrivateEndpointTypesClientListOptions contains the optional parameters for the AvailablePrivateEndpointTypesClient.NewListPager // method. @@ -75,7 +72,7 @@ func (client *AvailablePrivateEndpointTypesClient) NewListPager(location string, } // listCreateRequest creates the List request. -func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context.Context, location string, options *AvailablePrivateEndpointTypesClientListOptions) (*policy.Request, error) { +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") @@ -90,7 +87,7 @@ func (client *AvailablePrivateEndpointTypesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +105,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -137,7 +134,7 @@ func (client *AvailablePrivateEndpointTypesClient) NewListByResourceGroupPager(l } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailablePrivateEndpointTypesClientListByResourceGroupOptions) (*policy.Request, error) { +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 location == "" { return nil, errors.New("parameter location cannot be empty") @@ -156,7 +153,7 @@ func (client *AvailablePrivateEndpointTypesClient) listByResourceGroupCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 23250fc22e9e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableprivateendpointtypes_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailablePrivateEndpointTypesClient().NewListPager("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.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"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailablePrivateEndpointTypesClient().NewListByResourceGroupPager("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.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"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go index 63c742f340c8..3de33f3c652e 100644 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailableResourceGroupDelegationsClient(subscriptionID string, credentia // NewListPager - Gets all of the available subnet delegations for this resource group in this region. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -75,7 +72,7 @@ func (client *AvailableResourceGroupDelegationsClient) NewListPager(location str } // listCreateRequest creates the List request. -func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx context.Context, location string, resourceGroupName string, options *AvailableResourceGroupDelegationsClientListOptions) (*policy.Request, error) { +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 location == "" { return nil, errors.New("parameter location cannot be empty") @@ -94,7 +91,7 @@ func (client *AvailableResourceGroupDelegationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index dcac73642165..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableresourcegroupdelegations_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableResourceGroupDelegationsClient().NewListPager("westcentralus", "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.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"), - // 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 25fed378647b..33a16cc6b48c 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailableServiceAliasesClient(subscriptionID string, credential azcore.T // NewListPager - Gets all available service aliases for this subscription in this region. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location. // - options - AvailableServiceAliasesClientListOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListPager // method. @@ -74,7 +71,7 @@ func (client *AvailableServiceAliasesClient) NewListPager(location string, optio } // listCreateRequest creates the List request. -func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Context, location string, options *AvailableServiceAliasesClientListOptions) (*policy.Request, error) { +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") @@ -89,7 +86,7 @@ func (client *AvailableServiceAliasesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +103,7 @@ func (client *AvailableServiceAliasesClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Gets all available service aliases for this resource group in this region. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - location - The location. // - options - AvailableServiceAliasesClientListByResourceGroupOptions contains the optional parameters for the AvailableServiceAliasesClient.NewListByResourceGroupPager @@ -135,7 +132,7 @@ func (client *AvailableServiceAliasesClient) NewListByResourceGroupPager(resourc } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, options *AvailableServiceAliasesClientListByResourceGroupOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -154,7 +151,7 @@ func (client *AvailableServiceAliasesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a3767ecfa297..000000000000 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableServiceAliasesClient().NewListPager("westcentralus", 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableServiceAliasesClient().NewListByResourceGroupPager("rg1", "westcentralus", 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.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"), - // }, - // { - // 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 60ef18967d63..a710397ef0ba 100644 --- a/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/availableservicealiases_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 1f3f6d7cbcdf..62b6879c5c1a 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntag_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go index 386bfe8f0f6c..9f7a41911303 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAzureFirewallFqdnTagsClient(subscriptionID string, credential azcore.Tok // NewListAllPager - Gets all the Azure Firewall FQDN Tags in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - AzureFirewallFqdnTagsClientListAllOptions contains the optional parameters for the AzureFirewallFqdnTagsClient.NewListAllPager // method. func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewallFqdnTagsClientListAllOptions) *runtime.Pager[AzureFirewallFqdnTagsClientListAllResponse] { @@ -73,7 +70,7 @@ func (client *AzureFirewallFqdnTagsClient) NewListAllPager(options *AzureFirewal } // listAllCreateRequest creates the ListAll request. -func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallFqdnTagsClientListAllOptions) (*policy.Request, error) { +func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Context, _ *AzureFirewallFqdnTagsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,7 +81,7 @@ func (client *AzureFirewallFqdnTagsClient) listAllCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index bd4d59fb8368..000000000000 --- a/sdk/resourcemanager/network/armnetwork/azurefirewallfqdntags_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallFqdnTagsClient().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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go index 798b5c858119..e3c2ab540ac3 100644 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go +++ b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to the create or update Azure Firewall operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall, _ *AzureFirewallsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *AzureFirewallsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *AzureFirewallsClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *AzureFirewallsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified Azure Firewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - options - AzureFirewallsClientGetOptions contains the optional parameters for the AzureFirewallsClient.Get method. @@ -232,7 +229,7 @@ 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, options *AzureFirewallsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *AzureFirewallsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +265,7 @@ func (client *AzureFirewallsClient) getHandleResponse(resp *http.Response) (Azur // NewListPager - Lists all Azure Firewalls in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - AzureFirewallsClientListOptions contains the optional parameters for the AzureFirewallsClient.NewListPager method. func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, options *AzureFirewallsClientListOptions) *runtime.Pager[AzureFirewallsClientListResponse] { @@ -295,7 +292,7 @@ func (client *AzureFirewallsClient) NewListPager(resourceGroupName string, optio } // listCreateRequest creates the List request. -func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AzureFirewallsClientListOptions) (*policy.Request, error) { +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") @@ -310,7 +307,7 @@ func (client *AzureFirewallsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +324,7 @@ func (client *AzureFirewallsClient) listHandleResponse(resp *http.Response) (Azu // NewListAllPager - Gets all the Azure Firewalls in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - AzureFirewallsClientListAllOptions contains the optional parameters for the AzureFirewallsClient.NewListAllPager // method. func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClientListAllOptions) *runtime.Pager[AzureFirewallsClientListAllResponse] { @@ -354,7 +351,7 @@ func (client *AzureFirewallsClient) NewListAllPager(options *AzureFirewallsClien } // listAllCreateRequest creates the ListAll request. -func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, options *AzureFirewallsClientListAllOptions) (*policy.Request, error) { +func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, _ *AzureFirewallsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -365,7 +362,7 @@ func (client *AzureFirewallsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,7 +380,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the azure firewall. // - options - AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes @@ -409,7 +406,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*http.Response, error) { var err error const operationName = "AzureFirewallsClient.BeginListLearnedPrefixes" @@ -432,7 +429,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixes(ctx context.Context, res } // listLearnedPrefixesCreateRequest creates the ListLearnedPrefixes request. -func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context.Context, resourceGroupName string, azureFirewallName string, options *AzureFirewallsClientBeginListLearnedPrefixesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -451,7 +448,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -460,7 +457,7 @@ func (client *AzureFirewallsClient) listLearnedPrefixesCreateRequest(ctx context // BeginPacketCapture - Runs a packet capture on AzureFirewall. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to run packet capture on azure firewall. @@ -487,7 +484,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -510,7 +507,7 @@ 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, options *AzureFirewallsClientBeginPacketCaptureOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -529,7 +526,7 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -541,7 +538,7 @@ func (client *AzureFirewallsClient) packetCaptureCreateRequest(ctx context.Conte // BeginUpdateTags - Updates tags of an Azure Firewall resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - azureFirewallName - The name of the Azure Firewall. // - parameters - Parameters supplied to update azure firewall tags. @@ -568,7 +565,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -591,7 +588,7 @@ 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, options *AzureFirewallsClientBeginUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -610,7 +607,7 @@ func (client *AzureFirewallsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go b/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go deleted file mode 100644 index 0435e0b3a680..000000000000 --- a/sdk/resourcemanager/network/armnetwork/azurefirewalls_client_example_test.go +++ /dev/null @@ -1,2987 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - 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"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - 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")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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{ - 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{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - 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")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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"), - 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"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - 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")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - Properties: &armnetwork.AzureFirewallPropertiesFormat{ - 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{ - { - Name: to.Ptr("azureFirewallIpConfiguration"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - 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")}, - }}, - }, - }}, - 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")}, - }, nil) - if 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 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - 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"), - Properties: &armnetwork.AzureFirewallIPConfigurationPropertiesFormat{ - 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{ - 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"), - 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")}, - }}, - }, - }}, - SKU: &armnetwork.AzureFirewallSKU{ - Name: to.Ptr(armnetwork.AzureFirewallSKUNameAZFWVnet), - Tier: to.Ptr(armnetwork.AzureFirewallSKUTierStandard), - }, - ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // }, - // 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/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1"), - // }, - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallsClient().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.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")}, - // }}, - // }, - // }}, - // 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{ - // }, - // 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), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureFirewallsClient().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.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")}, - // }}, - // }, - // }}, - // 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{ - // }, - // 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), - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginListLearnedPrefixes(ctx, "rg1", "azureFirewall1", nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureFirewallsClient().BeginPacketCapture(ctx, "rg1", "azureFirewall1", armnetwork.FirewallPacketCaptureParameters{ - DurationInSeconds: to.Ptr[int32](300), - FileName: to.Ptr("azureFirewallPacketCapture"), - Filters: []*armnetwork.AzureFirewallPacketCaptureRule{ - { - DestinationPorts: []*string{ - to.Ptr("4500")}, - Destinations: []*string{ - to.Ptr("20.1.2.0")}, - Sources: []*string{ - to.Ptr("20.1.1.0")}, - }, - { - DestinationPorts: []*string{ - to.Ptr("123"), - to.Ptr("80")}, - Destinations: []*string{ - to.Ptr("10.1.2.0")}, - Sources: []*string{ - to.Ptr("10.1.1.0"), - 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), - }, 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/azurewebcategory_live_test.go b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go index ad4d12530531..0ad772907e28 100644 --- a/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/azurewebcategory_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 dd772b930191..9f692ddb2d54 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhost_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go index 39d56ad14332..f57459aa0e2d 100644 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go +++ b/sdk/resourcemanager/network/armnetwork/bastionhosts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to the create or update Bastion Host operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *BastionHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *BastionHostsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BastionHostsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *BastionHostsClient) deleteOperation(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *BastionHostsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *BastionHostsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified Bastion Host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - BastionHostsClientGetOptions contains the optional parameters for the BastionHostsClient.Get method. @@ -232,7 +229,7 @@ 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, options *BastionHostsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *BastionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +265,7 @@ func (client *BastionHostsClient) getHandleResponse(resp *http.Response) (Bastio // NewListPager - Lists all Bastion Hosts in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -294,7 +291,7 @@ func (client *BastionHostsClient) NewListPager(options *BastionHostsClientListOp } // listCreateRequest creates the List request. -func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options *BastionHostsClientListOptions) (*policy.Request, error) { +func (client *BastionHostsClient) listCreateRequest(ctx context.Context, _ *BastionHostsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -305,7 +302,7 @@ func (client *BastionHostsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +319,7 @@ func (client *BastionHostsClient) listHandleResponse(resp *http.Response) (Basti // NewListByResourceGroupPager - Lists all Bastion Hosts in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - BastionHostsClientListByResourceGroupOptions contains the optional parameters for the BastionHostsClient.NewListByResourceGroupPager // method. @@ -350,7 +347,7 @@ func (client *BastionHostsClient) NewListByResourceGroupPager(resourceGroupName } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BastionHostsClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -365,7 +362,7 @@ func (client *BastionHostsClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,7 +380,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - parameters - Parameters supplied to update BastionHost tags. @@ -410,7 +407,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -433,7 +430,7 @@ func (client *BastionHostsClient) updateTags(ctx context.Context, resourceGroupN } // updateTagsCreateRequest creates the UpdateTags request. -func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, options *BastionHostsClientBeginUpdateTagsOptions) (*policy.Request, error) { +func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject, _ *BastionHostsClientBeginUpdateTagsOptions) (*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") @@ -452,7 +449,7 @@ func (client *BastionHostsClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go b/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go deleted file mode 100644 index ce29ccde438b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/bastionhosts_client_example_test.go +++ /dev/null @@ -1,980 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg1", "bastionhosttenant", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBastionHostsClient().BeginDelete(ctx, "rg2", "bastionhostdeveloper", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNameStandard), - // }, - // Zones: []*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhosttenant", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBastionHostsClient().Get(ctx, "rg1", "bastionhostdeveloper'", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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{ - // { - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBastionHostsClient().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.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"), - // }, - // }, - // }}, - // 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{ - // }, - // 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), - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBastionHostsClient().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.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"), - // }, - // }, - // }}, - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ScaleUnits: to.Ptr[int32](2), - // }, - // SKU: &armnetwork.SKU{ - // Name: to.Ptr(armnetwork.BastionHostSKUNamePremium), - // }, - // Zones: []*string{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go index e018e227facb..a4e29894ef97 100644 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go +++ b/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewBgpServiceCommunitiesClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets all the available bgp service communities. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - BgpServiceCommunitiesClientListOptions contains the optional parameters for the BgpServiceCommunitiesClient.NewListPager // method. func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommunitiesClientListOptions) *runtime.Pager[BgpServiceCommunitiesClientListResponse] { @@ -73,7 +70,7 @@ func (client *BgpServiceCommunitiesClient) NewListPager(options *BgpServiceCommu } // listCreateRequest creates the List request. -func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context, options *BgpServiceCommunitiesClientListOptions) (*policy.Request, error) { +func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context, _ *BgpServiceCommunitiesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,7 +81,7 @@ func (client *BgpServiceCommunitiesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index c9937c70e0d3..000000000000 --- a/sdk/resourcemanager/network/armnetwork/bgpservicecommunities_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBgpServiceCommunitiesClient().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.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")}, - // 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"), - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go index 51398cc719bf..381c4b09be5b 100644 --- a/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/checkdnsavailability_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/client_factory.go b/sdk/resourcemanager/network/armnetwork/client_factory.go index 1a46e2b8b2d7..40b0d9376d29 100644 --- a/sdk/resourcemanager/network/armnetwork/client_factory.go +++ b/sdk/resourcemanager/network/armnetwork/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -644,6 +641,14 @@ func (c *ClientFactory) NewNatRulesClient() *NatRulesClient { } } +// NewNspAssociationReconcileClient creates a new instance of NspAssociationReconcileClient. +func (c *ClientFactory) NewNspAssociationReconcileClient() *NspAssociationReconcileClient { + return &NspAssociationReconcileClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ @@ -843,6 +848,78 @@ func (c *ClientFactory) NewSecurityPartnerProvidersClient() *SecurityPartnerProv } } +// NewSecurityPerimeterAccessRulesClient creates a new instance of SecurityPerimeterAccessRulesClient. +func (c *ClientFactory) NewSecurityPerimeterAccessRulesClient() *SecurityPerimeterAccessRulesClient { + return &SecurityPerimeterAccessRulesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterAssociableResourceTypesClient creates a new instance of SecurityPerimeterAssociableResourceTypesClient. +func (c *ClientFactory) NewSecurityPerimeterAssociableResourceTypesClient() *SecurityPerimeterAssociableResourceTypesClient { + return &SecurityPerimeterAssociableResourceTypesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterAssociationsClient creates a new instance of SecurityPerimeterAssociationsClient. +func (c *ClientFactory) NewSecurityPerimeterAssociationsClient() *SecurityPerimeterAssociationsClient { + return &SecurityPerimeterAssociationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterLinkReferencesClient creates a new instance of SecurityPerimeterLinkReferencesClient. +func (c *ClientFactory) NewSecurityPerimeterLinkReferencesClient() *SecurityPerimeterLinkReferencesClient { + return &SecurityPerimeterLinkReferencesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterLinksClient creates a new instance of SecurityPerimeterLinksClient. +func (c *ClientFactory) NewSecurityPerimeterLinksClient() *SecurityPerimeterLinksClient { + return &SecurityPerimeterLinksClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterLoggingConfigurationsClient creates a new instance of SecurityPerimeterLoggingConfigurationsClient. +func (c *ClientFactory) NewSecurityPerimeterLoggingConfigurationsClient() *SecurityPerimeterLoggingConfigurationsClient { + return &SecurityPerimeterLoggingConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterOperationStatusesClient creates a new instance of SecurityPerimeterOperationStatusesClient. +func (c *ClientFactory) NewSecurityPerimeterOperationStatusesClient() *SecurityPerimeterOperationStatusesClient { + return &SecurityPerimeterOperationStatusesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimeterProfilesClient creates a new instance of SecurityPerimeterProfilesClient. +func (c *ClientFactory) NewSecurityPerimeterProfilesClient() *SecurityPerimeterProfilesClient { + return &SecurityPerimeterProfilesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewSecurityPerimetersClient creates a new instance of SecurityPerimetersClient. +func (c *ClientFactory) NewSecurityPerimetersClient() *SecurityPerimetersClient { + return &SecurityPerimetersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewSecurityRulesClient creates a new instance of SecurityRulesClient. func (c *ClientFactory) NewSecurityRulesClient() *SecurityRulesClient { return &SecurityRulesClient{ diff --git a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go index 1c615a8956e7..3d4d27be320c 100644 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, options *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VPNServerConfigurationPolicyGroup, _ *ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationPolicyGroupParameters); err != nil { @@ -133,7 +130,7 @@ func (client *ConfigurationPolicyGroupsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the ConfigurationPolicyGroup. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, _ *ConfigurationPolicyGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ConfigurationPolicyGroupsClient) deleteCreateRequest(ctx context.C // Get - Retrieves the details of a ConfigurationPolicyGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - configurationPolicyGroupName - The name of the ConfigurationPolicyGroup being retrieved. @@ -244,7 +241,7 @@ func (client *ConfigurationPolicyGroupsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, options *ConfigurationPolicyGroupsClientGetOptions) (*policy.Request, error) { +func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, _ *ConfigurationPolicyGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *ConfigurationPolicyGroupsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ConfigurationPolicyGroupsClient) getHandleResponse(resp *http.Resp // NewListByVPNServerConfigurationPager - Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration. // - options - ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager @@ -313,7 +310,7 @@ func (client *ConfigurationPolicyGroupsClient) NewListByVPNServerConfigurationPa } // listByVPNServerConfigurationCreateRequest creates the ListByVPNServerConfiguration request. -func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) (*policy.Request, error) { +func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, _ *ConfigurationPolicyGroupsClientListByVPNServerConfigurationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *ConfigurationPolicyGroupsClient) listByVPNServerConfigurationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 32c342728c45..000000000000 --- a/sdk/resourcemanager/network/armnetwork/configurationpolicygroups_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationPolicyGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", armnetwork.VPNServerConfigurationPolicyGroup{ - 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"), - }}, - Priority: to.Ptr[int32](0), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationPolicyGroupsClient().BeginDelete(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationPolicyGroupsClient().Get(ctx, "rg1", "vpnServerConfiguration1", "policyGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationPolicyGroupsClient().NewListByVPNServerConfigurationPager("rg1", "vpnServerConfiguration1", 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.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"), - // }, - // { - // 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("policy2"), - // AttributeType: to.Ptr(armnetwork.VPNPolicyMemberAttributeTypeCertificateGroupID), - // AttributeValue: to.Ptr("red.com"), - // }}, - // 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 1e94426f50b4..d19322bf6780 100644 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +118,7 @@ func (client *ConnectionMonitorsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Migrate != nil { reqQP.Set("migrate", *options.Migrate) } @@ -136,7 +133,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -163,7 +160,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -186,7 +183,7 @@ 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, options *ConnectionMonitorsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -209,7 +206,7 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +215,7 @@ func (client *ConnectionMonitorsClient) deleteCreateRequest(ctx context.Context, // Get - Gets a connection monitor by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -246,7 +243,7 @@ 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, options *ConnectionMonitorsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -269,7 +266,7 @@ func (client *ConnectionMonitorsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +283,7 @@ func (client *ConnectionMonitorsClient) getHandleResponse(resp *http.Response) ( // NewListPager - Lists all connection monitors for the specified Network Watcher. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - options - ConnectionMonitorsClientListOptions contains the optional parameters for the ConnectionMonitorsClient.NewListPager @@ -316,7 +313,7 @@ func (client *ConnectionMonitorsClient) NewListPager(resourceGroupName string, n } // listCreateRequest creates the List request. -func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *ConnectionMonitorsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -335,7 +332,7 @@ func (client *ConnectionMonitorsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,174 +347,10 @@ func (client *ConnectionMonitorsClient) listHandleResponse(resp *http.Response) return result, nil } -// BeginQuery - Query a snapshot of the most recent connection states. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. -// - connectionMonitorName - The name given to the connection monitor. -// - options - ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery -// method. -func (client *ConnectionMonitorsClient) BeginQuery(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*runtime.Poller[ConnectionMonitorsClientQueryResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.query(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientQueryResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectionMonitorsClientQueryResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Query - Query a snapshot of the most recent connection states. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01 -func (client *ConnectionMonitorsClient) query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*http.Response, error) { - var err error - const operationName = "ConnectionMonitorsClient.BeginQuery" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.queryCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, 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 -} - -// queryCreateRequest creates the Query request. -func (client *ConnectionMonitorsClient) queryCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginQueryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - 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", "2024-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01 -// - resourceGroupName - The name of the resource group containing Network Watcher. -// - networkWatcherName - The name of the Network Watcher resource. -// - connectionMonitorName - The name of the connection monitor. -// - options - ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart -// method. -func (client *ConnectionMonitorsClient) BeginStart(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*runtime.Poller[ConnectionMonitorsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectionMonitorsClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectionMonitorsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts the specified connection monitor. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01 -func (client *ConnectionMonitorsClient) start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "ConnectionMonitorsClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, 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 -} - -// startCreateRequest creates the Start request. -func (client *ConnectionMonitorsClient) startCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *ConnectionMonitorsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if networkWatcherName == "" { - return nil, errors.New("parameter networkWatcherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{networkWatcherName}", url.PathEscape(networkWatcherName)) - if connectionMonitorName == "" { - 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", "2024-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // BeginStop - Stops the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - connectionMonitorName - The name of the connection monitor. @@ -544,7 +377,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -567,7 +400,7 @@ 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, options *ConnectionMonitorsClientBeginStopOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -590,7 +423,7 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +432,7 @@ func (client *ConnectionMonitorsClient) stopCreateRequest(ctx context.Context, r // UpdateTags - Update tags of the specified connection monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - connectionMonitorName - The name of the connection monitor. @@ -629,7 +462,7 @@ 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, options *ConnectionMonitorsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -652,7 +485,7 @@ func (client *ConnectionMonitorsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go b/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go deleted file mode 100644 index 7629f2c5bcb9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/connectionmonitors_client_example_test.go +++ /dev/null @@ -1,721 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "cm1", armnetwork.ConnectionMonitor{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.ConnectionMonitorParameters{ - 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")}, - }}, - }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) - if 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "cm1", armnetwork.ConnectionMonitor{ - Properties: &armnetwork.ConnectionMonitorParameters{ - 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"), - }, - { - Name: to.Ptr("bing"), - Address: to.Ptr("bing.com"), - }, - { - 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), - }, - 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")}, - Disable: to.Ptr(false), - Sources: []*string{ - to.Ptr("vm1"), - to.Ptr("CanaryWorkspaceVamshi")}, - TestConfigurations: []*string{ - to.Ptr("testConfig1")}, - }}, - }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) - if 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.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"), - // }}, - // }, - // 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"), - // }, - // { - // 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), - // }, - // 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")}, - // Disable: to.Ptr(false), - // Sources: []*string{ - // to.Ptr("vm1"), - // to.Ptr("CanaryWorkspaceVamshi")}, - // TestConfigurations: []*string{ - // to.Ptr("testConfig1")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginCreateOrUpdate(ctx, "rg1", "nw1", "cm1", armnetwork.ConnectionMonitor{ - Properties: &armnetwork.ConnectionMonitorParameters{ - 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"), - }, - { - 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{ - { - 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), - }}, - 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")}, - }}, - }, - }, &armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions{Migrate: nil}) - if 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.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"), - // }, - // 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"), - // }}, - // Outputs: []*armnetwork.ConnectionMonitorOutput{ - // }, - // 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), - // }}, - // 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")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectionMonitorsClient().BeginDelete(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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherConnectionMonitorStart.json -func ExampleConnectionMonitorsClient_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.NewConnectionMonitorsClient().BeginStart(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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherConnectionMonitorQuery.json -func ExampleConnectionMonitorsClient_BeginQuery() { - cred, err := 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().BeginQuery(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 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.ConnectionMonitorQueryResult = armnetwork.ConnectionMonitorQueryResult{ - // SourceStatus: to.Ptr(armnetwork.ConnectionMonitorSourceStatusActive), - // States: []*armnetwork.ConnectionStateSnapshot{ - // { - // ConnectionState: to.Ptr(armnetwork.ConnectionStateReachable), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-08T05:12:41.526Z"); return t}()), - // EvaluationState: to.Ptr(armnetwork.EvaluationStateCompleted), - // 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/rg1/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/rg1/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-08T03:42:33.338Z"); return t}()), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectionMonitorsClient().NewListPager("rg1", "nw1", 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.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"), - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go index fe590913732a..07eabcee2042 100644 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -78,7 +75,7 @@ func (client *ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, options *ConnectivityConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, connectivityConfiguration ConnectivityConfiguration, _ *ConnectivityConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,7 +98,7 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectivityConfiguration); err != nil { @@ -123,7 +120,7 @@ func (client *ConnectivityConfigurationsClient) createOrUpdateHandleResponse(res // and connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -151,7 +148,7 @@ func (client *ConnectivityConfigurationsClient) BeginDelete(ctx context.Context, // connectivity configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -197,7 +194,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -210,7 +207,7 @@ func (client *ConnectivityConfigurationsClient) deleteCreateRequest(ctx context. // Configuration name // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager connectivity configuration. @@ -239,7 +236,7 @@ func (client *ConnectivityConfigurationsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ConnectivityConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, _ *ConnectivityConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -262,7 +259,7 @@ func (client *ConnectivityConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +276,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ConnectivityConfigurationsClientListOptions contains the optional parameters for the ConnectivityConfigurationsClient.NewListPager @@ -333,7 +330,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index bcca2c7ed289..000000000000 --- a/sdk/resourcemanager/network/armnetwork/connectivityconfigurations_client_example_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectivityConfigurationsClient().CreateOrUpdate(ctx, "myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", armnetwork.ConnectivityConfiguration{ - 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), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectivityConfigurationsClient().NewListPager("myResourceGroup", "testNetworkManager", &armnetwork.ConnectivityConfigurationsClientListOptions{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.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), - // }}, - // 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 eb9395b8adbe..75f41a219db9 100644 --- a/sdk/resourcemanager/network/armnetwork/constants.go +++ b/sdk/resourcemanager/network/armnetwork/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package armnetwork const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" - moduleVersion = "v6.2.0" + moduleVersion = "v7.0.0" ) // Access - Access to be allowed or denied. @@ -29,6 +26,22 @@ func PossibleAccessValues() []Access { } } +// AccessRuleDirection - Direction that specifies whether the access rules is inbound/outbound. +type AccessRuleDirection string + +const ( + AccessRuleDirectionInbound AccessRuleDirection = "Inbound" + AccessRuleDirectionOutbound AccessRuleDirection = "Outbound" +) + +// PossibleAccessRuleDirectionValues returns the possible values for the AccessRuleDirection const type. +func PossibleAccessRuleDirectionValues() []AccessRuleDirection { + return []AccessRuleDirection{ + AccessRuleDirectionInbound, + AccessRuleDirectionOutbound, + } +} + // ActionType - Defines the action to take on rule match. type ActionType string @@ -119,6 +132,39 @@ func PossibleAdminStateValues() []AdminState { } } +// AdvertisedPublicPrefixPropertiesValidationState - Advertised Public Prefix State that denotes if the prefix is validated +// or not. +type AdvertisedPublicPrefixPropertiesValidationState string + +const ( + AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed AdvertisedPublicPrefixPropertiesValidationState = "AsnValidationFailed" + 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" +) + +// PossibleAdvertisedPublicPrefixPropertiesValidationStateValues returns the possible values for the AdvertisedPublicPrefixPropertiesValidationState const type. +func PossibleAdvertisedPublicPrefixPropertiesValidationStateValues() []AdvertisedPublicPrefixPropertiesValidationState { + return []AdvertisedPublicPrefixPropertiesValidationState{ + AdvertisedPublicPrefixPropertiesValidationStateAsnValidationFailed, + AdvertisedPublicPrefixPropertiesValidationStateCertificateMissingInRoutingRegistry, + AdvertisedPublicPrefixPropertiesValidationStateConfigured, + AdvertisedPublicPrefixPropertiesValidationStateConfiguring, + AdvertisedPublicPrefixPropertiesValidationStateInvalidSignatureEncoding, + AdvertisedPublicPrefixPropertiesValidationStateManualValidationNeeded, + AdvertisedPublicPrefixPropertiesValidationStateNotConfigured, + AdvertisedPublicPrefixPropertiesValidationStateSignatureVerificationFailed, + AdvertisedPublicPrefixPropertiesValidationStateValidationFailed, + AdvertisedPublicPrefixPropertiesValidationStateValidationNeeded, + } +} + // ApplicationGatewayBackendHealthServerHealth - Health of backend server. type ApplicationGatewayBackendHealthServerHealth string @@ -240,16 +286,20 @@ func PossibleApplicationGatewayFirewallRateLimitDurationValues() []ApplicationGa type ApplicationGatewayFirewallUserSessionVariable string const ( - ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" - ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" - ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" + ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" + ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader ApplicationGatewayFirewallUserSessionVariable = "ClientAddrXFFHeader" + ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" + ApplicationGatewayFirewallUserSessionVariableGeoLocationXFFHeader ApplicationGatewayFirewallUserSessionVariable = "GeoLocationXFFHeader" + ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" ) // PossibleApplicationGatewayFirewallUserSessionVariableValues returns the possible values for the ApplicationGatewayFirewallUserSessionVariable const type. func PossibleApplicationGatewayFirewallUserSessionVariableValues() []ApplicationGatewayFirewallUserSessionVariable { return []ApplicationGatewayFirewallUserSessionVariable{ ApplicationGatewayFirewallUserSessionVariableClientAddr, + ApplicationGatewayFirewallUserSessionVariableClientAddrXFFHeader, ApplicationGatewayFirewallUserSessionVariableGeoLocation, + ApplicationGatewayFirewallUserSessionVariableGeoLocationXFFHeader, ApplicationGatewayFirewallUserSessionVariableNone, } } @@ -643,6 +693,24 @@ func PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWaf } } +// AssociationAccessMode - Access mode on the association. +type AssociationAccessMode string + +const ( + AssociationAccessModeAudit AssociationAccessMode = "Audit" + AssociationAccessModeEnforced AssociationAccessMode = "Enforced" + AssociationAccessModeLearning AssociationAccessMode = "Learning" +) + +// PossibleAssociationAccessModeValues returns the possible values for the AssociationAccessMode const type. +func PossibleAssociationAccessModeValues() []AssociationAccessMode { + return []AssociationAccessMode{ + AssociationAccessModeAudit, + AssociationAccessModeEnforced, + AssociationAccessModeLearning, + } +} + // AssociationType - The association type of the child resource to the parent resource. type AssociationType string @@ -977,6 +1045,47 @@ func PossibleConfigurationTypeValues() []ConfigurationType { } } +// ConnectedGroupAddressOverlap - Behavior to handle overlapped IP address space among members of the connected group of the +// connectivity configuration. +type ConnectedGroupAddressOverlap string + +const ( + // ConnectedGroupAddressOverlapAllowed - Default. Allows connected group members to have overlapping IP address space. + ConnectedGroupAddressOverlapAllowed ConnectedGroupAddressOverlap = "Allowed" + // ConnectedGroupAddressOverlapDisallowed - Strictly disallows connected group members from having overlapping IP address + // space. Prevents the addition of a virtual network with overlapping address to the connected group, blocks peering between + // a virtual network and a connected group member if any connected group member has an overlapping range, and restricts address + // space modifications that would introduce overlap. + ConnectedGroupAddressOverlapDisallowed ConnectedGroupAddressOverlap = "Disallowed" +) + +// PossibleConnectedGroupAddressOverlapValues returns the possible values for the ConnectedGroupAddressOverlap const type. +func PossibleConnectedGroupAddressOverlapValues() []ConnectedGroupAddressOverlap { + return []ConnectedGroupAddressOverlap{ + ConnectedGroupAddressOverlapAllowed, + ConnectedGroupAddressOverlapDisallowed, + } +} + +// ConnectedGroupPrivateEndpointScale - Option indicating the scale of private endpoints allowed in the connected group of +// the connectivity configuration. +type ConnectedGroupPrivateEndpointScale string + +const ( + // ConnectedGroupPrivateEndpointScaleHighScale - Allows for up to 20K private endpoints in the connected group. + ConnectedGroupPrivateEndpointScaleHighScale ConnectedGroupPrivateEndpointScale = "HighScale" + // ConnectedGroupPrivateEndpointScaleStandard - Default. Allows for up to 2K private endpoints in the connected group. + ConnectedGroupPrivateEndpointScaleStandard ConnectedGroupPrivateEndpointScale = "Standard" +) + +// PossibleConnectedGroupPrivateEndpointScaleValues returns the possible values for the ConnectedGroupPrivateEndpointScale const type. +func PossibleConnectedGroupPrivateEndpointScaleValues() []ConnectedGroupPrivateEndpointScale { + return []ConnectedGroupPrivateEndpointScale{ + ConnectedGroupPrivateEndpointScaleHighScale, + ConnectedGroupPrivateEndpointScaleStandard, + } +} + // ConnectionMonitorEndpointFilterItemType - The type of item included in the filter. Currently only 'AgentAddress' is supported. type ConnectionMonitorEndpointFilterItemType string @@ -2892,6 +3001,76 @@ func PossibleNicTypeInResponseValues() []NicTypeInResponse { } } +// NspLinkProvisioningState - The current provisioning state of NSP Link/LinkReference. +type NspLinkProvisioningState string + +const ( + NspLinkProvisioningStateAccepted NspLinkProvisioningState = "Accepted" + NspLinkProvisioningStateCreating NspLinkProvisioningState = "Creating" + NspLinkProvisioningStateDeleting NspLinkProvisioningState = "Deleting" + NspLinkProvisioningStateFailed NspLinkProvisioningState = "Failed" + NspLinkProvisioningStateSucceeded NspLinkProvisioningState = "Succeeded" + NspLinkProvisioningStateUpdating NspLinkProvisioningState = "Updating" + NspLinkProvisioningStateWaitForRemoteCompletion NspLinkProvisioningState = "WaitForRemoteCompletion" +) + +// PossibleNspLinkProvisioningStateValues returns the possible values for the NspLinkProvisioningState const type. +func PossibleNspLinkProvisioningStateValues() []NspLinkProvisioningState { + return []NspLinkProvisioningState{ + NspLinkProvisioningStateAccepted, + NspLinkProvisioningStateCreating, + NspLinkProvisioningStateDeleting, + NspLinkProvisioningStateFailed, + NspLinkProvisioningStateSucceeded, + NspLinkProvisioningStateUpdating, + NspLinkProvisioningStateWaitForRemoteCompletion, + } +} + +// NspLinkStatus - The NSP link state. +type NspLinkStatus string + +const ( + NspLinkStatusApproved NspLinkStatus = "Approved" + NspLinkStatusDisconnected NspLinkStatus = "Disconnected" + NspLinkStatusPending NspLinkStatus = "Pending" + NspLinkStatusRejected NspLinkStatus = "Rejected" +) + +// PossibleNspLinkStatusValues returns the possible values for the NspLinkStatus const type. +func PossibleNspLinkStatusValues() []NspLinkStatus { + return []NspLinkStatus{ + NspLinkStatusApproved, + NspLinkStatusDisconnected, + NspLinkStatusPending, + NspLinkStatusRejected, + } +} + +// NspProvisioningState - The current provisioning state. +type NspProvisioningState string + +const ( + NspProvisioningStateAccepted NspProvisioningState = "Accepted" + NspProvisioningStateCreating NspProvisioningState = "Creating" + NspProvisioningStateDeleting NspProvisioningState = "Deleting" + NspProvisioningStateFailed NspProvisioningState = "Failed" + NspProvisioningStateSucceeded NspProvisioningState = "Succeeded" + NspProvisioningStateUpdating NspProvisioningState = "Updating" +) + +// PossibleNspProvisioningStateValues returns the possible values for the NspProvisioningState const type. +func PossibleNspProvisioningStateValues() []NspProvisioningState { + return []NspProvisioningState{ + NspProvisioningStateAccepted, + NspProvisioningStateCreating, + NspProvisioningStateDeleting, + NspProvisioningStateFailed, + NspProvisioningStateSucceeded, + NspProvisioningStateUpdating, + } +} + // OfficeTrafficCategory - The office traffic category. type OfficeTrafficCategory string @@ -3074,6 +3253,26 @@ func PossiblePcStatusValues() []PcStatus { } } +// PeeringEnforcement - Option indicating enforcement of peerings created by the connectivity configuration. +type PeeringEnforcement string + +const ( + // PeeringEnforcementEnforced - Peerings created by the connectivity configuration will not be modifiable or deletable outside + // of the network manager. + PeeringEnforcementEnforced PeeringEnforcement = "Enforced" + // PeeringEnforcementUnenforced - Default. Peerings created by the connectivity configuration may be modified or deleted outside + // of the network manager. + PeeringEnforcementUnenforced PeeringEnforcement = "Unenforced" +) + +// PossiblePeeringEnforcementValues returns the possible values for the PeeringEnforcement const type. +func PossiblePeeringEnforcementValues() []PeeringEnforcement { + return []PeeringEnforcement{ + PeeringEnforcementEnforced, + PeeringEnforcementUnenforced, + } +} + // PfsGroup - The Pfs Groups used in IKE Phase 2 for new child SA. type PfsGroup string @@ -4272,6 +4471,86 @@ func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGateway } } +// VirtualNetworkGatewayMigrationPhase - Represent the current migration phase of gateway. +type VirtualNetworkGatewayMigrationPhase string + +const ( + // VirtualNetworkGatewayMigrationPhaseAbort - Gateway is going through abort migration or abort has failed. Please see state + // and error details for more information. + VirtualNetworkGatewayMigrationPhaseAbort VirtualNetworkGatewayMigrationPhase = "Abort" + // VirtualNetworkGatewayMigrationPhaseAbortSucceeded - Represent abort succeeded on gateway, start with prepare to retrigger + // migration. + VirtualNetworkGatewayMigrationPhaseAbortSucceeded VirtualNetworkGatewayMigrationPhase = "AbortSucceeded" + // VirtualNetworkGatewayMigrationPhaseCommit - Gateway is going through commit migration or commit has failed. Please see + // state and error details for more information. + VirtualNetworkGatewayMigrationPhaseCommit VirtualNetworkGatewayMigrationPhase = "Commit" + // VirtualNetworkGatewayMigrationPhaseCommitSucceeded - Commit succeeded, represent migration is complete for the gateway. + VirtualNetworkGatewayMigrationPhaseCommitSucceeded VirtualNetworkGatewayMigrationPhase = "CommitSucceeded" + // VirtualNetworkGatewayMigrationPhaseExecute - Gateway is going through execute migration or execute has failed. Please see + // state and error details for more information. + VirtualNetworkGatewayMigrationPhaseExecute VirtualNetworkGatewayMigrationPhase = "Execute" + // VirtualNetworkGatewayMigrationPhaseExecuteSucceeded - Execute succeeded on gateway. + VirtualNetworkGatewayMigrationPhaseExecuteSucceeded VirtualNetworkGatewayMigrationPhase = "ExecuteSucceeded" + // VirtualNetworkGatewayMigrationPhaseNone - No migration phase set on gateway. + VirtualNetworkGatewayMigrationPhaseNone VirtualNetworkGatewayMigrationPhase = "None" + // VirtualNetworkGatewayMigrationPhasePrepare - Gateway is going through prepare migration or prepare has failed. Please see + // state and error details for more information. + VirtualNetworkGatewayMigrationPhasePrepare VirtualNetworkGatewayMigrationPhase = "Prepare" + // VirtualNetworkGatewayMigrationPhasePrepareSucceeded - Prepare succeeded on gateway. + VirtualNetworkGatewayMigrationPhasePrepareSucceeded VirtualNetworkGatewayMigrationPhase = "PrepareSucceeded" +) + +// PossibleVirtualNetworkGatewayMigrationPhaseValues returns the possible values for the VirtualNetworkGatewayMigrationPhase const type. +func PossibleVirtualNetworkGatewayMigrationPhaseValues() []VirtualNetworkGatewayMigrationPhase { + return []VirtualNetworkGatewayMigrationPhase{ + VirtualNetworkGatewayMigrationPhaseAbort, + VirtualNetworkGatewayMigrationPhaseAbortSucceeded, + VirtualNetworkGatewayMigrationPhaseCommit, + VirtualNetworkGatewayMigrationPhaseCommitSucceeded, + VirtualNetworkGatewayMigrationPhaseExecute, + VirtualNetworkGatewayMigrationPhaseExecuteSucceeded, + VirtualNetworkGatewayMigrationPhaseNone, + VirtualNetworkGatewayMigrationPhasePrepare, + VirtualNetworkGatewayMigrationPhasePrepareSucceeded, + } +} + +// VirtualNetworkGatewayMigrationState - Represent the current state of gateway migration. +type VirtualNetworkGatewayMigrationState string + +const ( + VirtualNetworkGatewayMigrationStateFailed VirtualNetworkGatewayMigrationState = "Failed" + VirtualNetworkGatewayMigrationStateInProgress VirtualNetworkGatewayMigrationState = "InProgress" + VirtualNetworkGatewayMigrationStateNone VirtualNetworkGatewayMigrationState = "None" + VirtualNetworkGatewayMigrationStateSucceeded VirtualNetworkGatewayMigrationState = "Succeeded" +) + +// PossibleVirtualNetworkGatewayMigrationStateValues returns the possible values for the VirtualNetworkGatewayMigrationState const type. +func PossibleVirtualNetworkGatewayMigrationStateValues() []VirtualNetworkGatewayMigrationState { + return []VirtualNetworkGatewayMigrationState{ + VirtualNetworkGatewayMigrationStateFailed, + VirtualNetworkGatewayMigrationStateInProgress, + VirtualNetworkGatewayMigrationStateNone, + VirtualNetworkGatewayMigrationStateSucceeded, + } +} + +// VirtualNetworkGatewayMigrationType - MigrationType for the virtual network gateway. +type VirtualNetworkGatewayMigrationType string + +const ( + // VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP - Indicates that it is a migration process from basic IP + // CSES to standard IP VMSS. + VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP VirtualNetworkGatewayMigrationType = "UpgradeDeploymentToStandardIP" +) + +// PossibleVirtualNetworkGatewayMigrationTypeValues returns the possible values for the VirtualNetworkGatewayMigrationType const type. +func PossibleVirtualNetworkGatewayMigrationTypeValues() []VirtualNetworkGatewayMigrationType { + return []VirtualNetworkGatewayMigrationType{ + VirtualNetworkGatewayMigrationTypeUpgradeDeploymentToStandardIP, + } +} + // VirtualNetworkGatewaySKUName - Gateway SKU name. type VirtualNetworkGatewaySKUName string diff --git a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go index 34e77892e764..5db581a56be3 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefix_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go index 4340573a8f3d..e3c23ed44800 100644 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/customipprefixes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to the create or update custom IP prefix operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *CustomIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *CustomIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the CustomIpPrefix. // - options - CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomIPPrefixesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *CustomIPPrefixesClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customIPPrefixName string, options *CustomIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *CustomIPPrefixesClient) deleteCreateRequest(ctx context.Context, r // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - options - CustomIPPrefixesClientGetOptions contains the optional parameters for the CustomIPPrefixesClient.Get method. @@ -254,7 +251,7 @@ func (client *CustomIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *CustomIPPrefixesClient) getHandleResponse(resp *http.Response) (Cu // NewListPager - Gets all custom IP prefixes in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - CustomIPPrefixesClientListOptions contains the optional parameters for the CustomIPPrefixesClient.NewListPager // method. @@ -299,7 +296,7 @@ func (client *CustomIPPrefixesClient) NewListPager(resourceGroupName string, opt } // listCreateRequest creates the List request. -func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CustomIPPrefixesClientListOptions) (*policy.Request, error) { +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") @@ -314,7 +311,7 @@ func (client *CustomIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *CustomIPPrefixesClient) listHandleResponse(resp *http.Response) (C // NewListAllPager - Gets all the custom IP prefixes in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - CustomIPPrefixesClientListAllOptions contains the optional parameters for the CustomIPPrefixesClient.NewListAllPager // method. func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesClientListAllOptions) *runtime.Pager[CustomIPPrefixesClientListAllResponse] { @@ -358,7 +355,7 @@ func (client *CustomIPPrefixesClient) NewListAllPager(options *CustomIPPrefixesC } // listAllCreateRequest creates the ListAll request. -func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *CustomIPPrefixesClientListAllOptions) (*policy.Request, error) { +func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, _ *CustomIPPrefixesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *CustomIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - customIPPrefixName - The name of the custom IP prefix. // - parameters - Parameters supplied to update custom IP prefix tags. @@ -416,7 +413,7 @@ 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, options *CustomIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -435,7 +432,7 @@ func (client *CustomIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go deleted file mode 100644 index 71bca36a2fde..000000000000 --- a/sdk/resourcemanager/network/armnetwork/customipprefixes_client_example_test.go +++ /dev/null @@ -1,627 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomIPPrefixesClient().BeginDelete(ctx, "rg1", "test-customipprefix", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomIPPrefixesClient().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.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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomIPPrefixesClient().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.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{ - // }, - // 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/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{ - // }, - // 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"), - // }, - // }, - // { - // 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{ - // }, - // 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-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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go index ff5c08f89f41..5223629b07e1 100644 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to the create or update operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *DdosCustomPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *DdosCustomPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosCustomPoliciesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *DdosCustomPoliciesClient) deleteOperation(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *DdosCustomPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Gets information about the specified DDoS custom policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - options - DdosCustomPoliciesClientGetOptions contains the optional parameters for the DdosCustomPoliciesClient.Get method. @@ -232,7 +229,7 @@ func (client *DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, options *DdosCustomPoliciesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *DdosCustomPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *DdosCustomPoliciesClient) getHandleResponse(resp *http.Response) ( // UpdateTags - Update a DDoS custom policy tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosCustomPolicyName - The name of the DDoS custom policy. // - parameters - Parameters supplied to update DDoS custom policy resource tags. @@ -298,7 +295,7 @@ 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, options *DdosCustomPoliciesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -317,7 +314,7 @@ func (client *DdosCustomPoliciesClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go deleted file mode 100644 index 6092143b6589..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ddoscustompolicies_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosCustomPoliciesClient().BeginDelete(ctx, "rg1", "test-ddos-custom-policy", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosCustomPoliciesClient().Get(ctx, "rg1", "test-ddos-custom-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.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{ - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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"), - }, nil) - if 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.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{ - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDdosCustomPoliciesClient().UpdateTags(ctx, "rg1", "test-ddos-custom-policy", 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.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{ - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go index d979108a056f..3ebbef0b8f48 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplan_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go index 744620b5164b..0b45016187d4 100644 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go +++ b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the create or update operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *DdosProtectionPlansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *DdosProtectionPlansClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DdosProtectionPlansClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *DdosProtectionPlansClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *DdosProtectionPlansClient) deleteCreateRequest(ctx context.Context // Get - Gets information about the specified DDoS protection plan. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - options - DdosProtectionPlansClientGetOptions contains the optional parameters for the DdosProtectionPlansClient.Get method. @@ -232,7 +229,7 @@ func (client *DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, options *DdosProtectionPlansClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *DdosProtectionPlansClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +265,7 @@ func (client *DdosProtectionPlansClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all DDoS protection plans in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - DdosProtectionPlansClientListOptions contains the optional parameters for the DdosProtectionPlansClient.NewListPager // method. func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPlansClientListOptions) *runtime.Pager[DdosProtectionPlansClientListResponse] { @@ -295,7 +292,7 @@ func (client *DdosProtectionPlansClient) NewListPager(options *DdosProtectionPla } // listCreateRequest creates the List request. -func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, options *DdosProtectionPlansClientListOptions) (*policy.Request, error) { +func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, _ *DdosProtectionPlansClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -306,7 +303,7 @@ func (client *DdosProtectionPlansClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +320,7 @@ func (client *DdosProtectionPlansClient) listHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all the DDoS protection plans in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - DdosProtectionPlansClientListByResourceGroupOptions contains the optional parameters for the DdosProtectionPlansClient.NewListByResourceGroupPager // method. @@ -351,7 +348,7 @@ func (client *DdosProtectionPlansClient) NewListByResourceGroupPager(resourceGro } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DdosProtectionPlansClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -366,7 +363,7 @@ func (client *DdosProtectionPlansClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +381,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ddosProtectionPlanName - The name of the DDoS protection plan. // - parameters - Parameters supplied to the update DDoS protection plan resource tags. @@ -413,7 +410,7 @@ 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, options *DdosProtectionPlansClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -432,7 +429,7 @@ func (client *DdosProtectionPlansClient) updateTagsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go deleted file mode 100644 index fa75e5a29142..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ddosprotectionplans_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDdosProtectionPlansClient().BeginDelete(ctx, "rg1", "test-plan", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDdosProtectionPlansClient().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.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"), - // }}, - // }, - // }, - // { - // 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"), - // }, - // { - // 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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDdosProtectionPlansClient().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.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"), - // }}, - // }, - // }, - // { - // 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"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go index 3678338bc2ba..4b4d501e9f36 100644 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - defaultSecurityRuleName - The name of the default security rule. @@ -76,7 +73,7 @@ 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, options *DefaultSecurityRulesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *DefaultSecurityRulesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +113,7 @@ func (client *DefaultSecurityRulesClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all default security rules in a network security group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - DefaultSecurityRulesClientListOptions contains the optional parameters for the DefaultSecurityRulesClient.NewListPager @@ -145,7 +142,7 @@ func (client *DefaultSecurityRulesClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *DefaultSecurityRulesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -164,7 +161,7 @@ func (client *DefaultSecurityRulesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index cbb0034c68e4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/defaultsecurityrules_client_example_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDefaultSecurityRulesClient().NewListPager("testrg", "nsg1", 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.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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 b42795445065..755281477346 100644 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - parameters - Parameters supplied to the create or update dscp configuration operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *DscpConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *DscpConfigurationClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DscpConfigurationClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *DscpConfigurationClient) deleteOperation(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *DscpConfigurationClient) deleteCreateRequest(ctx context.Context, // Get - Gets a DSCP Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - dscpConfigurationName - The name of the resource. // - options - DscpConfigurationClientGetOptions contains the optional parameters for the DscpConfigurationClient.Get method. @@ -232,7 +229,7 @@ func (client *DscpConfigurationClient) Get(ctx context.Context, resourceGroupNam } // getCreateRequest creates the Get request. -func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, dscpConfigurationName string, options *DscpConfigurationClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *DscpConfigurationClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +265,7 @@ func (client *DscpConfigurationClient) getHandleResponse(resp *http.Response) (D // NewListPager - Gets a DSCP Configuration. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - DscpConfigurationClientListOptions contains the optional parameters for the DscpConfigurationClient.NewListPager // method. @@ -296,7 +293,7 @@ func (client *DscpConfigurationClient) NewListPager(resourceGroupName string, op } // listCreateRequest creates the List request. -func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *DscpConfigurationClientListOptions) (*policy.Request, error) { +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") @@ -311,7 +308,7 @@ func (client *DscpConfigurationClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +325,7 @@ func (client *DscpConfigurationClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all dscp configurations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - DscpConfigurationClientListAllOptions contains the optional parameters for the DscpConfigurationClient.NewListAllPager // method. func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfigurationClientListAllOptions) *runtime.Pager[DscpConfigurationClientListAllResponse] { @@ -355,7 +352,7 @@ func (client *DscpConfigurationClient) NewListAllPager(options *DscpConfiguratio } // listAllCreateRequest creates the ListAll request. -func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, options *DscpConfigurationClientListAllOptions) (*policy.Request, error) { +func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, _ *DscpConfigurationClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -366,7 +363,7 @@ func (client *DscpConfigurationClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 2545c32df00f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/dscpconfiguration_client_example_test.go +++ /dev/null @@ -1,602 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDscpConfigurationClient().BeginCreateOrUpdate(ctx, "rg1", "mydscpconfig", armnetwork.DscpConfiguration{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.DscpConfigurationPropertiesFormat{ - 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](15), - Start: to.Ptr[int32](15), - }}, - 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](11), - Start: to.Ptr[int32](10), - }, - { - End: to.Ptr[int32](21), - Start: to.Ptr[int32](20), - }}, - 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), - }}, - }, - }, nil) - if 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.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)}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDscpConfigurationClient().BeginDelete(ctx, "rg1", "mydscpConfig", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDscpConfigurationClient().Get(ctx, "rg1", "mydscpConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // { - // 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)}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDscpConfigurationClient().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.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"), - // }, - // { - // 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)}, - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDscpConfigurationClient().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.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"), - // }, - // { - // 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)}, - // 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/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 805d54f9303c..c43e48adaa26 100644 --- a/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/endpointservice_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 60155afd15e3..7e106efa078b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuit_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go index 25ffbfd54392..e78ee82a7df2 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteOperation(ctx conte } // deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, options *ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) deleteCreateRequest(ctx c // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - authorizationName - The name of the authorization. @@ -244,7 +241,7 @@ 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, options *ExpressRouteCircuitAuthorizationsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) getHandleResponse(resp *h // NewListPager - Gets all authorizations in an express route circuit. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - options - ExpressRouteCircuitAuthorizationsClientListOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.NewListPager @@ -313,7 +310,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) NewListPager(resourceGrou } // listCreateRequest creates the List request. -func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitAuthorizationsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ExpressRouteCircuitAuthorizationsClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7bb37a02b30c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitauthorizations_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().BeginDelete(ctx, "rg1", "circuitName", "authorizationName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitAuthorizationsClient().Get(ctx, "rg1", "circuitName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitAuthorizationsClient().NewListPager("rg1", "circuitName", 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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go index 96aea0946f92..8649f2e5bef2 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -77,7 +74,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -100,7 +97,7 @@ 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, options *ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -127,7 +124,7 @@ func (client *ExpressRouteCircuitConnectionsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteCircuitConnectionParameters); err != nil { @@ -139,7 +136,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -167,7 +164,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -190,7 +187,7 @@ 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, options *ExpressRouteCircuitConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -217,7 +214,7 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +223,7 @@ func (client *ExpressRouteCircuitConnectionsClient) deleteCreateRequest(ctx cont // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -256,7 +253,7 @@ 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, options *ExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -283,7 +280,7 @@ func (client *ExpressRouteCircuitConnectionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +297,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -330,7 +327,7 @@ func (client *ExpressRouteCircuitConnectionsClient) NewListPager(resourceGroupNa } // listCreateRequest creates the List request. -func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *ExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -353,7 +350,7 @@ func (client *ExpressRouteCircuitConnectionsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 3f0263d80b87..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitconnections_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitConnectionsClient().BeginDelete(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitConnectionsClient().NewListPager("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", 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.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"), - // 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), - // }, - // }, - // { - // 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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go index 0e734f307719..dcf030fb92e5 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ExpressRouteCircuitPeeringsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *ExpressRouteCircuitPeeringsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ExpressRouteCircuitPeeringsClient) deleteCreateRequest(ctx context // Get - Gets the specified peering for the express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -244,7 +241,7 @@ 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, options *ExpressRouteCircuitPeeringsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ExpressRouteCircuitPeeringsClient) getHandleResponse(resp *http.Re // NewListPager - Gets all peerings in a specified express route circuit. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitPeeringsClientListOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.NewListPager @@ -313,7 +310,7 @@ func (client *ExpressRouteCircuitPeeringsClient) NewListPager(resourceGroupName } // listCreateRequest creates the List request. -func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitPeeringsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ExpressRouteCircuitPeeringsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index be8096c9ec2f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuitpeerings_client_example_test.go +++ /dev/null @@ -1,266 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitPeeringsClient().BeginDelete(ctx, "rg1", "circuitName", "peeringName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCircuitPeeringsClient().Get(ctx, "rg1", "circuitName", "MicrosoftPeering", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // 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"), - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // 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"), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitPeeringsClient().NewListPager("rg1", "circuitName", 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.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")}, - // AdvertisedPublicPrefixesState: to.Ptr(armnetwork.ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - // CustomerASN: to.Ptr[int32](23), - // LegacyMode: to.Ptr[int32](0), - // RoutingRegistryName: to.Ptr("ARIN"), - // }, - // 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"), - // MicrosoftPeeringConfig: &armnetwork.ExpressRouteCircuitPeeringConfig{ - // 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"), - // }, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go index 51b386a2a3b7..1bda575eb13c 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - parameters - Parameters supplied to the create or update express route circuit operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *ExpressRouteCircuitsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *ExpressRouteCircuitsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteCircuitsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *ExpressRouteCircuitsClient) deleteOperation(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *ExpressRouteCircuitsClient) deleteCreateRequest(ctx context.Contex // Get - Gets information about the specified express route circuit. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of express route circuit. // - options - ExpressRouteCircuitsClientGetOptions contains the optional parameters for the ExpressRouteCircuitsClient.Get @@ -233,7 +230,7 @@ func (client *ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *ExpressRouteCircuitsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *ExpressRouteCircuitsClient) getHandleResponse(resp *http.Response) // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -299,7 +296,7 @@ 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, options *ExpressRouteCircuitsClientGetPeeringStatsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -322,7 +319,7 @@ func (client *ExpressRouteCircuitsClient) getPeeringStatsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +337,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - options - ExpressRouteCircuitsClientGetStatsOptions contains the optional parameters for the ExpressRouteCircuitsClient.GetStats @@ -368,7 +365,7 @@ func (client *ExpressRouteCircuitsClient) GetStats(ctx context.Context, resource } // getStatsCreateRequest creates the GetStats request. -func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, options *ExpressRouteCircuitsClientGetStatsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -387,7 +384,7 @@ func (client *ExpressRouteCircuitsClient) getStatsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +401,7 @@ func (client *ExpressRouteCircuitsClient) getStatsHandleResponse(resp *http.Resp // NewListPager - Gets all the express route circuits in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCircuitsClientListOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListPager // method. @@ -432,7 +429,7 @@ func (client *ExpressRouteCircuitsClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCircuitsClientListOptions) (*policy.Request, error) { +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") @@ -447,7 +444,7 @@ func (client *ExpressRouteCircuitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +461,7 @@ func (client *ExpressRouteCircuitsClient) listHandleResponse(resp *http.Response // NewListAllPager - Gets all the express route circuits in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteCircuitsClientListAllOptions contains the optional parameters for the ExpressRouteCircuitsClient.NewListAllPager // method. func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteCircuitsClientListAllOptions) *runtime.Pager[ExpressRouteCircuitsClientListAllResponse] { @@ -491,7 +488,7 @@ func (client *ExpressRouteCircuitsClient) NewListAllPager(options *ExpressRouteC } // listAllCreateRequest creates the ListAll request. -func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Context, options *ExpressRouteCircuitsClientListAllOptions) (*policy.Request, error) { +func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Context, _ *ExpressRouteCircuitsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -502,7 +499,7 @@ func (client *ExpressRouteCircuitsClient) listAllCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -520,7 +517,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -548,7 +545,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -571,7 +568,7 @@ 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, options *ExpressRouteCircuitsClientBeginListArpTableOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -598,7 +595,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -608,7 +605,7 @@ func (client *ExpressRouteCircuitsClient) listArpTableCreateRequest(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -636,7 +633,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -659,7 +656,7 @@ 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, options *ExpressRouteCircuitsClientBeginListRoutesTableOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -686,7 +683,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -696,7 +693,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableCreateRequest(ctx conte // in a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -725,7 +722,7 @@ func (client *ExpressRouteCircuitsClient) BeginListRoutesTableSummary(ctx contex // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -748,7 +745,7 @@ 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, options *ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -775,7 +772,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -784,7 +781,7 @@ func (client *ExpressRouteCircuitsClient) listRoutesTableSummaryCreateRequest(ct // UpdateTags - Updates an express route circuit tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - parameters - Parameters supplied to update express route circuit tags. @@ -813,7 +810,7 @@ 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, options *ExpressRouteCircuitsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -832,7 +829,7 @@ func (client *ExpressRouteCircuitsClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go deleted file mode 100644 index 0451bc88f3ab..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecircuits_client_example_test.go +++ /dev/null @@ -1,644 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginCreateOrUpdate(ctx, "rg1", "circuitName", armnetwork.ExpressRouteCircuit{ - Location: to.Ptr("Brazil South"), - Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - AllowClassicOperations: to.Ptr(false), - Authorizations: []*armnetwork.ExpressRouteCircuitAuthorization{}, - Peerings: []*armnetwork.ExpressRouteCircuitPeering{}, - 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), - }, - }, nil) - if 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.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{ - // }, - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCircuitsClient().BeginCreateOrUpdate(ctx, "rg1", "expressRouteCircuit1", armnetwork.ExpressRouteCircuit{ - Location: to.Ptr("westus"), - Properties: &armnetwork.ExpressRouteCircuitPropertiesFormat{ - AuthorizationKey: to.Ptr("b0be57f5-1fba-463b-adec-ffe767354cdd"), - BandwidthInGbps: to.Ptr[float32](10), - 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), - }, - }, nil) - if 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.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{ - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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(""), - // LocPrf: to.Ptr(""), - // Network: to.Ptr(""), - // NextHop: to.Ptr(""), - // Weight: to.Ptr[int32](0), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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.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: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitsClient().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.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), - // }, - // }}, - // 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), - // }, - // 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), - // }, - // }}, - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteCircuitsClient().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.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), - // }, - // }}, - // 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), - // }, - // 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), - // }, - // }}, - // 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), - // }, - // SKU: &armnetwork.ExpressRouteCircuitSKU{ - // Name: to.Ptr("Standard_MeteredData"), - // Family: to.Ptr(armnetwork.ExpressRouteCircuitSKUFamilyMeteredData), - // Tier: to.Ptr(armnetwork.ExpressRouteCircuitSKUTierStandard), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go index da0b52483ef6..95087705e675 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ExpressRouteConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ExpressRouteConnectionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteConnectionParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the connection subresource. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *ExpressRouteConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ExpressRouteConnectionsClient) deleteCreateRequest(ctx context.Con // Get - Gets the specified ExpressRouteConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - connectionName - The name of the ExpressRoute connection. @@ -244,7 +241,7 @@ 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, options *ExpressRouteConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ExpressRouteConnectionsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +282,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteConnectionsClientListOptions contains the optional parameters for the ExpressRouteConnectionsClient.List @@ -313,7 +310,7 @@ func (client *ExpressRouteConnectionsClient) List(ctx context.Context, resourceG } // listCreateRequest creates the List request. -func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteConnectionsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ExpressRouteConnectionsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 1bcdc8a689a5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteconnections_client_example_test.go +++ /dev/null @@ -1,266 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - Properties: &armnetwork.ExpressRouteConnectionProperties{ - AuthorizationKey: to.Ptr("authorizationKey"), - ExpressRouteCircuitPeering: &armnetwork.ExpressRouteCircuitPeeringID{ - ID: to.Ptr("/subscriptions/subid/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"), - }, - 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](2), - }, - }, nil) - if 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.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"), - // }, - // 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](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteConnectionsClient().Get(ctx, "resourceGroupName", "expressRouteGatewayName", "connectionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteConnectionsClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteConnectionsClient().List(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.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"), - // }, - // 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), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go index 0ee7169ee32f..3c49445650da 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, peeringParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteOperation(ctx con } // deleteCreateRequest creates the Delete request. -func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, options *ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) deleteCreateRequest(ctx // Get - Gets the specified peering for the ExpressRouteCrossConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -244,7 +241,7 @@ 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, options *ExpressRouteCrossConnectionPeeringsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) getHandleResponse(resp // NewListPager - Gets all peerings in a specified ExpressRouteCrossConnection. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - options - ExpressRouteCrossConnectionPeeringsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.NewListPager @@ -313,7 +310,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) NewListPager(resourceGr } // listCreateRequest creates the List request. -func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionPeeringsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ExpressRouteCrossConnectionPeeringsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 0a1126ca8c28..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnectionpeerings_client_example_test.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().BeginDelete(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCrossConnectionPeeringsClient().Get(ctx, "CrossConnection-SiliconValley", "", "AzurePrivatePeering", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 b831b4ab8736..cb3f6b8ac9f5 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - parameters - Parameters supplied to the update express route crossConnection operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *ExpressRouteCrossConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group (peering location of the circuit). // - crossConnectionName - The name of the ExpressRouteCrossConnection (service key of the circuit). // - options - ExpressRouteCrossConnectionsClientGetOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.Get @@ -156,7 +153,7 @@ func (client *ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, crossConnectionName string, options *ExpressRouteCrossConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -175,7 +172,7 @@ func (client *ExpressRouteCrossConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +189,7 @@ func (client *ExpressRouteCrossConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves all the ExpressRouteCrossConnections in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteCrossConnectionsClientListOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListPager // method. func (client *ExpressRouteCrossConnectionsClient) NewListPager(options *ExpressRouteCrossConnectionsClientListOptions) *runtime.Pager[ExpressRouteCrossConnectionsClientListResponse] { @@ -233,7 +230,7 @@ func (client *ExpressRouteCrossConnectionsClient) listCreateRequest(ctx context. if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +249,7 @@ func (client *ExpressRouteCrossConnectionsClient) listHandleResponse(resp *http. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -281,7 +278,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListArpTable(ctx context. // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -304,7 +301,7 @@ 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, options *ExpressRouteCrossConnectionsClientBeginListArpTableOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -331,7 +328,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +336,7 @@ func (client *ExpressRouteCrossConnectionsClient) listArpTableCreateRequest(ctx // NewListByResourceGroupPager - Retrieves all the ExpressRouteCrossConnections in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteCrossConnectionsClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager // method. @@ -367,7 +364,7 @@ func (client *ExpressRouteCrossConnectionsClient) NewListByResourceGroupPager(re } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteCrossConnectionsClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -382,7 +379,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +398,7 @@ func (client *ExpressRouteCrossConnectionsClient) listByResourceGroupHandleRespo // a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -430,7 +427,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTable(ctx conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -453,7 +450,7 @@ 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, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -480,7 +477,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -490,7 +487,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableCreateRequest(c // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the ExpressRouteCrossConnection. // - peeringName - The name of the peering. @@ -519,7 +516,7 @@ func (client *ExpressRouteCrossConnectionsClient) BeginListRoutesTableSummary(ct // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -542,7 +539,7 @@ 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, options *ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -569,7 +566,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -578,7 +575,7 @@ func (client *ExpressRouteCrossConnectionsClient) listRoutesTableSummaryCreateRe // UpdateTags - Updates an express route cross connection tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - crossConnectionName - The name of the cross connection. // - crossConnectionParameters - Parameters supplied to update express route cross connection tags. @@ -607,7 +604,7 @@ 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, options *ExpressRouteCrossConnectionsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -626,7 +623,7 @@ func (client *ExpressRouteCrossConnectionsClient) updateTagsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, crossConnectionParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go deleted file mode 100644 index 48a853ae2dbe..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutecrossconnections_client_example_test.go +++ /dev/null @@ -1,366 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteCrossConnectionsClient().Get(ctx, "CrossConnection-SiliconValley", "", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRouteCrossConnectionsClient().BeginListRoutesTableSummary(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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // { - // 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), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go index 952e5af33372..4dff0bf4d81e 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - putExpressRouteGatewayParameters - Parameters required in an ExpressRoute gateway PUT operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *ExpressRouteGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, putExpressRouteGatewayParameters); err != nil { @@ -129,7 +126,7 @@ func (client *ExpressRouteGatewaysClient) createOrUpdateCreateRequest(ctx contex // be deleted when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete @@ -156,7 +153,7 @@ func (client *ExpressRouteGatewaysClient) BeginDelete(ctx context.Context, resou // when there are no connection subresources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRouteGatewaysClient.BeginDelete" @@ -179,7 +176,7 @@ func (client *ExpressRouteGatewaysClient) deleteOperation(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -198,7 +195,7 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +204,7 @@ func (client *ExpressRouteGatewaysClient) deleteCreateRequest(ctx context.Contex // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRouteGatewayName - The name of the ExpressRoute gateway. // - options - ExpressRouteGatewaysClientGetOptions contains the optional parameters for the ExpressRouteGatewaysClient.Get @@ -235,7 +232,7 @@ func (client *ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, options *ExpressRouteGatewaysClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -254,7 +251,7 @@ func (client *ExpressRouteGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +269,7 @@ func (client *ExpressRouteGatewaysClient) getHandleResponse(resp *http.Response) // ListByResourceGroup - Lists ExpressRoute gateways in a given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRouteGatewaysClientListByResourceGroupOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListByResourceGroup // method. @@ -299,7 +296,7 @@ func (client *ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Contex } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRouteGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -314,7 +311,7 @@ func (client *ExpressRouteGatewaysClient) listByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +329,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteGatewaysClientListBySubscriptionOptions contains the optional parameters for the ExpressRouteGatewaysClient.ListBySubscription // method. func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (ExpressRouteGatewaysClientListBySubscriptionResponse, error) { @@ -358,7 +355,7 @@ func (client *ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, options *ExpressRouteGatewaysClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ExpressRouteGatewaysClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +384,7 @@ func (client *ExpressRouteGatewaysClient) listBySubscriptionHandleResponse(resp // BeginUpdateTags - Updates express route gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the ExpressRouteGateway. // - expressRouteGatewayName - The name of the gateway. // - expressRouteGatewayParameters - Parameters supplied to update a virtual wan express route gateway tags. @@ -414,7 +411,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -437,7 +434,7 @@ func (client *ExpressRouteGatewaysClient) updateTags(ctx context.Context, resour } // updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, options *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { +func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject, _ *ExpressRouteGatewaysClientBeginUpdateTagsOptions) (*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") @@ -456,7 +453,7 @@ func (client *ExpressRouteGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, expressRouteGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go deleted file mode 100644 index 2eabe9870449..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutegateways_client_example_test.go +++ /dev/null @@ -1,337 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteGatewaysClient().ListBySubscription(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.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), - // }, - // }, - // 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"), - // }, - // 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"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteGatewaysClient().ListByResourceGroup(ctx, "resourceGroupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }, - // 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"), - // }, - // 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"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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("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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go index 71c1f29e02d1..063ed94c8f18 100644 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressroutelinks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - linkName - The name of the ExpressRouteLink resource. @@ -75,7 +72,7 @@ func (client *ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupNam } // getCreateRequest creates the Get request. -func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, options *ExpressRouteLinksClientGetOptions) (*policy.Request, error) { +func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string, _ *ExpressRouteLinksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *ExpressRouteLinksClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +112,7 @@ func (client *ExpressRouteLinksClient) getHandleResponse(resp *http.Response) (E // NewListPager - Retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - options - ExpressRouteLinksClientListOptions contains the optional parameters for the ExpressRouteLinksClient.NewListPager @@ -144,7 +141,7 @@ func (client *ExpressRouteLinksClient) NewListPager(resourceGroupName string, ex } // listCreateRequest creates the List request. -func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRouteLinksClientListOptions) (*policy.Request, error) { +func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, _ *ExpressRouteLinksClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +160,7 @@ func (client *ExpressRouteLinksClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a75976edd283..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressroutelinks_client_example_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteLinksClient().Get(ctx, "rg1", "portName", "linkName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteLinksClient().NewListPager("rg1", "portName", 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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go index b75717deafc3..6ca3887bae8a 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ExpressRoutePortAuthorizationsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authorizationParameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteOperation(ctx context. } // deleteCreateRequest creates the Delete request. -func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, options *ExpressRoutePortAuthorizationsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ExpressRoutePortAuthorizationsClient) deleteCreateRequest(ctx cont // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - authorizationName - The name of the authorization. @@ -244,7 +241,7 @@ 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, options *ExpressRoutePortAuthorizationsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ExpressRoutePortAuthorizationsClient) getHandleResponse(resp *http // NewListPager - Gets all authorizations in an express route port. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the express route port. // - options - ExpressRoutePortAuthorizationsClientListOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.NewListPager @@ -313,7 +310,7 @@ func (client *ExpressRoutePortAuthorizationsClient) NewListPager(resourceGroupNa } // listCreateRequest creates the List request. -func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortAuthorizationsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ExpressRoutePortAuthorizationsClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index fc4211e64b87..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportauthorizations_client_example_test.go +++ /dev/null @@ -1,148 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortAuthorizationsClient().BeginDelete(ctx, "rg1", "expressRoutePortName", "authorizationName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRoutePortAuthorizationsClient().Get(ctx, "rg1", "expressRoutePortName", "authorizationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortAuthorizationsClient().NewListPager("rg1", "expressRoutePortName", 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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go index 6f39f0083bf6..550f099c55a4 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteports_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to the create ExpressRoutePort operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *ExpressRoutePortsClient) createOrUpdate(ctx context.Context, resou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, options *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort, _ *ExpressRoutePortsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *ExpressRoutePortsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - options - ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ExpressRoutePortsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *ExpressRoutePortsClient) deleteOperation(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, _ *ExpressRoutePortsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *ExpressRoutePortsClient) deleteCreateRequest(ctx context.Context, // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - request - Request parameters supplied to generate a letter of authorization. @@ -234,7 +231,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, options *ExpressRoutePortsClientGenerateLOAOptions) (*policy.Request, error) { +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" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -253,7 +250,7 @@ func (client *ExpressRoutePortsClient) generateLOACreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -274,7 +271,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of ExpressRoutePort. // - options - ExpressRoutePortsClientGetOptions contains the optional parameters for the ExpressRoutePortsClient.Get method. @@ -301,7 +298,7 @@ func (client *ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupNam } // getCreateRequest creates the Get request. -func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, options *ExpressRoutePortsClientGetOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, _ *ExpressRoutePortsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -320,7 +317,7 @@ func (client *ExpressRoutePortsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +334,7 @@ func (client *ExpressRoutePortsClient) getHandleResponse(resp *http.Response) (E // NewListPager - List all the ExpressRoutePort resources in the specified subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRoutePortsClientListOptions contains the optional parameters for the ExpressRoutePortsClient.NewListPager // method. func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsClientListOptions) *runtime.Pager[ExpressRoutePortsClientListResponse] { @@ -364,7 +361,7 @@ func (client *ExpressRoutePortsClient) NewListPager(options *ExpressRoutePortsCl } // listCreateRequest creates the List request. -func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsClientListOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, _ *ExpressRoutePortsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -375,7 +372,7 @@ func (client *ExpressRoutePortsClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +389,7 @@ func (client *ExpressRoutePortsClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - List all the ExpressRoutePort resources in the specified resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ExpressRoutePortsClientListByResourceGroupOptions contains the optional parameters for the ExpressRoutePortsClient.NewListByResourceGroupPager // method. @@ -420,7 +417,7 @@ func (client *ExpressRoutePortsClient) NewListByResourceGroupPager(resourceGroup } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ExpressRoutePortsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ExpressRoutePortsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -435,7 +432,7 @@ func (client *ExpressRoutePortsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,7 +450,7 @@ func (client *ExpressRoutePortsClient) listByResourceGroupHandleResponse(resp *h // UpdateTags - Update ExpressRoutePort tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - expressRoutePortName - The name of the ExpressRoutePort resource. // - parameters - Parameters supplied to update ExpressRoutePort resource tags. @@ -482,7 +479,7 @@ func (client *ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceG } // updateTagsCreateRequest creates the UpdateTags request. -func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, options *ExpressRoutePortsClientUpdateTagsOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject, _ *ExpressRoutePortsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -501,7 +498,7 @@ func (client *ExpressRoutePortsClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go b/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go deleted file mode 100644 index bc0ecc5f5190..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteports_client_example_test.go +++ /dev/null @@ -1,519 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExpressRoutePortsClient().BeginDelete(ctx, "rg1", "portName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - PeeringLocation: to.Ptr("peeringLocationName"), - }, - }, nil) - if 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.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"), - // }, - // }, - // { - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // { - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsClient().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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsClient().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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go index 917531a0eae2..98c8bb65197b 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewExpressRoutePortsLocationsClient(subscriptionID string, credential azcor // peering location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - locationName - Name of the requested ExpressRoutePort peering location. // - options - ExpressRoutePortsLocationsClientGetOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.Get // method. @@ -75,7 +72,7 @@ func (client *ExpressRoutePortsLocationsClient) Get(ctx context.Context, locatio } // getCreateRequest creates the Get request. -func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Context, locationName string, options *ExpressRoutePortsLocationsClientGetOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Context, locationName string, _ *ExpressRoutePortsLocationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -90,7 +87,7 @@ func (client *ExpressRoutePortsLocationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +105,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRoutePortsLocationsClientListOptions contains the optional parameters for the ExpressRoutePortsLocationsClient.NewListPager // method. func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRoutePortsLocationsClientListOptions) *runtime.Pager[ExpressRoutePortsLocationsClientListResponse] { @@ -135,7 +132,7 @@ func (client *ExpressRoutePortsLocationsClient) NewListPager(options *ExpressRou } // listCreateRequest creates the List request. -func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Context, options *ExpressRoutePortsLocationsClientListOptions) (*policy.Request, error) { +func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Context, _ *ExpressRoutePortsLocationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -146,7 +143,7 @@ func (client *ExpressRoutePortsLocationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 73a01f5b91f9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteportslocations_client_example_test.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRoutePortsLocationsClient().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.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{ - // }, - // Contact: to.Ptr("email@address.com"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 7967c35da1d6..0f45b97142ca 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteProviderPortsLocationClientListOptions contains the optional parameters for the ExpressRouteProviderPortsLocationClient.List // method. func (client *ExpressRouteProviderPortsLocationClient) List(ctx context.Context, options *ExpressRouteProviderPortsLocationClientListOptions) (ExpressRouteProviderPortsLocationClientListResponse, error) { @@ -87,7 +84,7 @@ func (client *ExpressRouteProviderPortsLocationClient) listCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7df7dfb91d28..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteproviderportslocation_client_example_test.go +++ /dev/null @@ -1,73 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExpressRouteProviderPortsLocationClient().List(ctx, &armnetwork.ExpressRouteProviderPortsLocationClientListOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go index 903af3f31b3f..5a60648878b1 100644 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewExpressRouteServiceProvidersClient(subscriptionID string, credential azc // NewListPager - Gets all the available express route service providers. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ExpressRouteServiceProvidersClientListOptions contains the optional parameters for the ExpressRouteServiceProvidersClient.NewListPager // method. func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressRouteServiceProvidersClientListOptions) *runtime.Pager[ExpressRouteServiceProvidersClientListResponse] { @@ -73,7 +70,7 @@ func (client *ExpressRouteServiceProvidersClient) NewListPager(options *ExpressR } // listCreateRequest creates the List request. -func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context.Context, options *ExpressRouteServiceProvidersClientListOptions) (*policy.Request, error) { +func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context.Context, _ *ExpressRouteServiceProvidersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,7 +81,7 @@ func (client *ExpressRouteServiceProvidersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 31092ed3365e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/expressrouteserviceproviders_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExpressRouteServiceProvidersClient().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.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), - // }}, - // 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 c958a9eb29cc..a07bed06d78d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrulecollections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (a *AdminRuleCollectionsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AdminRuleCollectionsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AdminRuleCollectionsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AdminRuleCollectionsClient.Get": - resp, err = a.dispatchGet(req) - case "AdminRuleCollectionsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AdminRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if adminRuleCollectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = adminRuleCollectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdminRuleCollectionsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AdminRuleCollectionsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AdminRuleCollectionsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdminRuleCollectionsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AdminRuleCollectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -316,3 +332,9 @@ func (a *AdminRuleCollectionsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to AdminRuleCollectionsServerTransport +var adminRuleCollectionsServerTransportInterceptor 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/adminrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go index 6132879793aa..bd7309893dd0 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/adminrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (a *AdminRulesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AdminRulesClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AdminRulesClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AdminRulesClient.Get": - resp, err = a.dispatchGet(req) - case "AdminRulesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AdminRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if adminRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = adminRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdminRulesClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AdminRulesClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AdminRulesClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdminRulesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AdminRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -336,3 +352,9 @@ func (a *AdminRulesServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to AdminRulesServerTransport +var adminRulesServerTransportInterceptor 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/applicationgatewayprivateendpointconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go index 6f6b3959bca9..22ff41913853 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivateendpointconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) Do(req *ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationGatewayPrivateEndpointConnectionsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationGatewayPrivateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGatewayPrivateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationGatewayPrivateEndpointConnectionsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationGatewayPrivateEndpointConnectionsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (a *ApplicationGatewayPrivateEndpointConnectionsServerTransport) dispatchBe return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGatewayPrivateEndpointConnectionsServerTransport +var applicationGatewayPrivateEndpointConnectionsServerTransportInterceptor 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/applicationgatewayprivatelinkresources_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go index 7848befdbce3..c02a8616fc72 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewayprivatelinkresources_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) Do(req *http.Req return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationGatewayPrivateLinkResourcesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationGatewayPrivateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGatewayPrivateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGatewayPrivateLinkResourcesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -110,3 +126,9 @@ func (a *ApplicationGatewayPrivateLinkResourcesServerTransport) dispatchNewListP } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGatewayPrivateLinkResourcesServerTransport +var applicationGatewayPrivateLinkResourcesServerTransportInterceptor 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/applicationgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go index 801c4ef52703..c5c47109a9bc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -81,11 +78,11 @@ type ApplicationGatewaysServer struct { ListAvailableWafRuleSets func(ctx context.Context, options *armnetwork.ApplicationGatewaysClientListAvailableWafRuleSetsOptions) (resp azfake.Responder[armnetwork.ApplicationGatewaysClientListAvailableWafRuleSetsResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method ApplicationGatewaysClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *armnetwork.ApplicationGatewaysClientBeginStartOptions) (resp azfake.PollerResponder[armnetwork.ApplicationGatewaysClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method ApplicationGatewaysClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, applicationGatewayName string, options *armnetwork.ApplicationGatewaysClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.ApplicationGatewaysClientStopResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method ApplicationGatewaysClient.UpdateTags @@ -134,53 +131,72 @@ func (a *ApplicationGatewaysServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ApplicationGatewaysClient.BeginBackendHealth": - resp, err = a.dispatchBeginBackendHealth(req) - case "ApplicationGatewaysClient.BeginBackendHealthOnDemand": - resp, err = a.dispatchBeginBackendHealthOnDemand(req) - case "ApplicationGatewaysClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "ApplicationGatewaysClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationGatewaysClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationGatewaysClient.GetSSLPredefinedPolicy": - resp, err = a.dispatchGetSSLPredefinedPolicy(req) - case "ApplicationGatewaysClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationGatewaysClient.NewListAllPager": - resp, err = a.dispatchNewListAllPager(req) - case "ApplicationGatewaysClient.ListAvailableRequestHeaders": - resp, err = a.dispatchListAvailableRequestHeaders(req) - case "ApplicationGatewaysClient.ListAvailableResponseHeaders": - resp, err = a.dispatchListAvailableResponseHeaders(req) - case "ApplicationGatewaysClient.ListAvailableSSLOptions": - resp, err = a.dispatchListAvailableSSLOptions(req) - case "ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager": - resp, err = a.dispatchNewListAvailableSSLPredefinedPoliciesPager(req) - case "ApplicationGatewaysClient.ListAvailableServerVariables": - resp, err = a.dispatchListAvailableServerVariables(req) - case "ApplicationGatewaysClient.ListAvailableWafRuleSets": - resp, err = a.dispatchListAvailableWafRuleSets(req) - case "ApplicationGatewaysClient.BeginStart": - resp, err = a.dispatchBeginStart(req) - case "ApplicationGatewaysClient.BeginStop": - resp, err = a.dispatchBeginStop(req) - case "ApplicationGatewaysClient.UpdateTags": - resp, err = a.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (a *ApplicationGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if applicationGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGatewaysClient.BeginBackendHealth": + res.resp, res.err = a.dispatchBeginBackendHealth(req) + case "ApplicationGatewaysClient.BeginBackendHealthOnDemand": + res.resp, res.err = a.dispatchBeginBackendHealthOnDemand(req) + case "ApplicationGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "ApplicationGatewaysClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationGatewaysClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationGatewaysClient.GetSSLPredefinedPolicy": + res.resp, res.err = a.dispatchGetSSLPredefinedPolicy(req) + case "ApplicationGatewaysClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationGatewaysClient.NewListAllPager": + res.resp, res.err = a.dispatchNewListAllPager(req) + case "ApplicationGatewaysClient.ListAvailableRequestHeaders": + res.resp, res.err = a.dispatchListAvailableRequestHeaders(req) + case "ApplicationGatewaysClient.ListAvailableResponseHeaders": + res.resp, res.err = a.dispatchListAvailableResponseHeaders(req) + case "ApplicationGatewaysClient.ListAvailableSSLOptions": + res.resp, res.err = a.dispatchListAvailableSSLOptions(req) + case "ApplicationGatewaysClient.NewListAvailableSSLPredefinedPoliciesPager": + res.resp, res.err = a.dispatchNewListAvailableSSLPredefinedPoliciesPager(req) + case "ApplicationGatewaysClient.ListAvailableServerVariables": + res.resp, res.err = a.dispatchListAvailableServerVariables(req) + case "ApplicationGatewaysClient.ListAvailableWafRuleSets": + res.resp, res.err = a.dispatchListAvailableWafRuleSets(req) + case "ApplicationGatewaysClient.BeginStart": + res.resp, res.err = a.dispatchBeginStart(req) + case "ApplicationGatewaysClient.BeginStop": + res.resp, res.err = a.dispatchBeginStop(req) + case "ApplicationGatewaysClient.UpdateTags": + res.resp, res.err = a.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGatewaysServerTransport) dispatchBeginBackendHealth(req *http.Request) (*http.Response, error) { @@ -714,9 +730,9 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStart(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { a.beginStart.remove(req) @@ -758,9 +774,9 @@ func (a *ApplicationGatewaysServerTransport) dispatchBeginStop(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { a.beginStop.remove(req) @@ -805,3 +821,9 @@ func (a *ApplicationGatewaysServerTransport) dispatchUpdateTags(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGatewaysServerTransport +var applicationGatewaysServerTransportInterceptor 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/applicationgatewaywafdynamicmanifests_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go index 2de6e8ab2caa..638307398404 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifests_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (a *ApplicationGatewayWafDynamicManifestsServerTransport) Do(req *http.Requ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationGatewayWafDynamicManifestsClient.NewGetPager": - resp, err = a.dispatchNewGetPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationGatewayWafDynamicManifestsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGatewayWafDynamicManifestsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGatewayWafDynamicManifestsClient.NewGetPager": + res.resp, res.err = a.dispatchNewGetPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchNewGetPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (a *ApplicationGatewayWafDynamicManifestsServerTransport) dispatchNewGetPag } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGatewayWafDynamicManifestsServerTransport +var applicationGatewayWafDynamicManifestsServerTransportInterceptor 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/applicationgatewaywafdynamicmanifestsdefault_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go index 31c9c1750d42..c92b7ebda118 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationgatewaywafdynamicmanifestsdefault_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) Do(req *ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationGatewayWafDynamicManifestsDefaultClient.Get": - resp, err = a.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationGatewayWafDynamicManifestsDefaultServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationGatewayWafDynamicManifestsDefaultServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationGatewayWafDynamicManifestsDefaultClient.Get": + res.resp, res.err = a.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (a *ApplicationGatewayWafDynamicManifestsDefaultServerTransport) dispatchGe } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationGatewayWafDynamicManifestsDefaultServerTransport +var applicationGatewayWafDynamicManifestsDefaultServerTransportInterceptor 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/applicationsecuritygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go index 1affea079f0a..3d0296af4fc3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/applicationsecuritygroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (a *ApplicationSecurityGroupsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationSecurityGroupsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "ApplicationSecurityGroupsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "ApplicationSecurityGroupsClient.Get": - resp, err = a.dispatchGet(req) - case "ApplicationSecurityGroupsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "ApplicationSecurityGroupsClient.NewListAllPager": - resp, err = a.dispatchNewListAllPager(req) - case "ApplicationSecurityGroupsClient.UpdateTags": - resp, err = a.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationSecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationSecurityGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationSecurityGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationSecurityGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "ApplicationSecurityGroupsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "ApplicationSecurityGroupsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "ApplicationSecurityGroupsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "ApplicationSecurityGroupsClient.NewListAllPager": + res.resp, res.err = a.dispatchNewListAllPager(req) + case "ApplicationSecurityGroupsClient.UpdateTags": + res.resp, res.err = a.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationSecurityGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (a *ApplicationSecurityGroupsServerTransport) dispatchUpdateTags(req *http. } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationSecurityGroupsServerTransport +var applicationSecurityGroupsServerTransportInterceptor 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/availabledelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go index 13ca251dd9a0..e224b99f843d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availabledelegations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (a *AvailableDelegationsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableDelegationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableDelegationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableDelegationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableDelegationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableDelegationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableDelegationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (a *AvailableDelegationsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableDelegationsServerTransport +var availableDelegationsServerTransportInterceptor 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/availableendpointservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go index 531ec7088fac..5b1f3a590f0d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableendpointservices_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (a *AvailableEndpointServicesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableEndpointServicesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableEndpointServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableEndpointServicesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableEndpointServicesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableEndpointServicesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableEndpointServicesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (a *AvailableEndpointServicesServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableEndpointServicesServerTransport +var availableEndpointServicesServerTransportInterceptor 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/availableprivateendpointtypes_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go index da67169bbfa4..feace0db75a7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableprivateendpointtypes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -59,23 +56,42 @@ func (a *AvailablePrivateEndpointTypesServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailablePrivateEndpointTypesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailablePrivateEndpointTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availablePrivateEndpointTypesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availablePrivateEndpointTypesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailablePrivateEndpointTypesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AvailablePrivateEndpointTypesClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailablePrivateEndpointTypesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -155,3 +171,9 @@ func (a *AvailablePrivateEndpointTypesServerTransport) dispatchNewListByResource } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailablePrivateEndpointTypesServerTransport +var availablePrivateEndpointTypesServerTransportInterceptor 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/availableresourcegroupdelegations_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go index 2682423b72ed..16193fd874f3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableresourcegroupdelegations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (a *AvailableResourceGroupDelegationsServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableResourceGroupDelegationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableResourceGroupDelegationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableResourceGroupDelegationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableResourceGroupDelegationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableResourceGroupDelegationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableResourceGroupDelegationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -110,3 +126,9 @@ func (a *AvailableResourceGroupDelegationsServerTransport) dispatchNewListPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableResourceGroupDelegationsServerTransport +var availableResourceGroupDelegationsServerTransportInterceptor 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/availableservicealiases_server.go b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go index 37db0d55666b..412a2dec5f17 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/availableservicealiases_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -59,23 +56,42 @@ func (a *AvailableServiceAliasesServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableServiceAliasesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AvailableServiceAliasesClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableServiceAliasesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableServiceAliasesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableServiceAliasesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableServiceAliasesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AvailableServiceAliasesClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableServiceAliasesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -155,3 +171,9 @@ func (a *AvailableServiceAliasesServerTransport) dispatchNewListByResourceGroupP } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableServiceAliasesServerTransport +var availableServiceAliasesServerTransportInterceptor 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/azurefirewallfqdntags_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go index a9963941ed00..3ab0c15afbac 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewallfqdntags_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) @@ -52,21 +49,40 @@ func (a *AzureFirewallFqdnTagsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AzureFirewallFqdnTagsClient.NewListAllPager": - resp, err = a.dispatchNewListAllPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AzureFirewallFqdnTagsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if azureFirewallFqdnTagsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureFirewallFqdnTagsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureFirewallFqdnTagsClient.NewListAllPager": + res.resp, res.err = a.dispatchNewListAllPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureFirewallFqdnTagsServerTransport) dispatchNewListAllPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (a *AzureFirewallFqdnTagsServerTransport) dispatchNewListAllPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to AzureFirewallFqdnTagsServerTransport +var azureFirewallFqdnTagsServerTransportInterceptor 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/azurefirewalls_server.go b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go index 79706c2c2127..d5125fbdda97 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/azurefirewalls_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,7 +46,7 @@ type AzureFirewallsServer struct { BeginListLearnedPrefixes func(ctx context.Context, resourceGroupName string, azureFirewallName string, options *armnetwork.AzureFirewallsClientBeginListLearnedPrefixesOptions) (resp azfake.PollerResponder[armnetwork.AzureFirewallsClientListLearnedPrefixesResponse], errResp azfake.ErrorResponder) // BeginPacketCapture is the fake for method AzureFirewallsClient.BeginPacketCapture - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPacketCapture func(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters armnetwork.FirewallPacketCaptureParameters, options *armnetwork.AzureFirewallsClientBeginPacketCaptureOptions) (resp azfake.PollerResponder[armnetwork.AzureFirewallsClientPacketCaptureResponse], errResp azfake.ErrorResponder) // BeginUpdateTags is the fake for method AzureFirewallsClient.BeginUpdateTags @@ -94,35 +91,54 @@ func (a *AzureFirewallsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "AzureFirewallsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AzureFirewallsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AzureFirewallsClient.Get": - resp, err = a.dispatchGet(req) - case "AzureFirewallsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AzureFirewallsClient.NewListAllPager": - resp, err = a.dispatchNewListAllPager(req) - case "AzureFirewallsClient.BeginListLearnedPrefixes": - resp, err = a.dispatchBeginListLearnedPrefixes(req) - case "AzureFirewallsClient.BeginPacketCapture": - resp, err = a.dispatchBeginPacketCapture(req) - case "AzureFirewallsClient.BeginUpdateTags": - resp, err = a.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (a *AzureFirewallsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if azureFirewallsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureFirewallsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureFirewallsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AzureFirewallsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AzureFirewallsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AzureFirewallsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AzureFirewallsClient.NewListAllPager": + res.resp, res.err = a.dispatchNewListAllPager(req) + case "AzureFirewallsClient.BeginListLearnedPrefixes": + res.resp, res.err = a.dispatchBeginListLearnedPrefixes(req) + case "AzureFirewallsClient.BeginPacketCapture": + res.resp, res.err = a.dispatchBeginPacketCapture(req) + case "AzureFirewallsClient.BeginUpdateTags": + res.resp, res.err = a.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureFirewallsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -401,9 +417,9 @@ func (a *AzureFirewallsServerTransport) dispatchBeginPacketCapture(req *http.Req return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !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.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPacketCapture) { a.beginPacketCapture.remove(req) @@ -459,3 +475,9 @@ func (a *AzureFirewallsServerTransport) dispatchBeginUpdateTags(req *http.Reques return resp, nil } + +// set this to conditionally intercept incoming requests to AzureFirewallsServerTransport +var azureFirewallsServerTransportInterceptor 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/bastionhosts_server.go b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go index 38c804a14572..0d0bc36ea9bd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bastionhosts_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -82,31 +79,50 @@ func (b *BastionHostsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BastionHostsClient.BeginCreateOrUpdate": - resp, err = b.dispatchBeginCreateOrUpdate(req) - case "BastionHostsClient.BeginDelete": - resp, err = b.dispatchBeginDelete(req) - case "BastionHostsClient.Get": - resp, err = b.dispatchGet(req) - case "BastionHostsClient.NewListPager": - resp, err = b.dispatchNewListPager(req) - case "BastionHostsClient.NewListByResourceGroupPager": - resp, err = b.dispatchNewListByResourceGroupPager(req) - case "BastionHostsClient.BeginUpdateTags": - resp, err = b.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BastionHostsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if bastionHostsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = bastionHostsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BastionHostsClient.BeginCreateOrUpdate": + res.resp, res.err = b.dispatchBeginCreateOrUpdate(req) + case "BastionHostsClient.BeginDelete": + res.resp, res.err = b.dispatchBeginDelete(req) + case "BastionHostsClient.Get": + res.resp, res.err = b.dispatchGet(req) + case "BastionHostsClient.NewListPager": + res.resp, res.err = b.dispatchNewListPager(req) + case "BastionHostsClient.NewListByResourceGroupPager": + res.resp, res.err = b.dispatchNewListByResourceGroupPager(req) + case "BastionHostsClient.BeginUpdateTags": + res.resp, res.err = b.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BastionHostsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -351,3 +367,9 @@ func (b *BastionHostsServerTransport) dispatchBeginUpdateTags(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to BastionHostsServerTransport +var bastionHostsServerTransportInterceptor 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/bgpservicecommunities_server.go b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go index 69959c571646..a01f5feae03b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/bgpservicecommunities_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) @@ -52,21 +49,40 @@ func (b *BgpServiceCommunitiesServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} - switch method { - case "BgpServiceCommunitiesClient.NewListPager": - resp, err = b.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (b *BgpServiceCommunitiesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if bgpServiceCommunitiesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = bgpServiceCommunitiesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BgpServiceCommunitiesClient.NewListPager": + res.resp, res.err = b.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BgpServiceCommunitiesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (b *BgpServiceCommunitiesServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to BgpServiceCommunitiesServerTransport +var bgpServiceCommunitiesServerTransportInterceptor 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 fb63c90db098..5a317c618843 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/configurationpolicygroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (c *ConfigurationPolicyGroupsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConfigurationPolicyGroupsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConfigurationPolicyGroupsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ConfigurationPolicyGroupsClient.Get": - resp, err = c.dispatchGet(req) - case "ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager": - resp, err = c.dispatchNewListByVPNServerConfigurationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConfigurationPolicyGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if configurationPolicyGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = configurationPolicyGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConfigurationPolicyGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConfigurationPolicyGroupsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ConfigurationPolicyGroupsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConfigurationPolicyGroupsClient.NewListByVPNServerConfigurationPager": + res.resp, res.err = c.dispatchNewListByVPNServerConfigurationPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConfigurationPolicyGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (c *ConfigurationPolicyGroupsServerTransport) dispatchNewListByVPNServerCon } return resp, nil } + +// set this to conditionally intercept incoming requests to ConfigurationPolicyGroupsServerTransport +var configurationPolicyGroupsServerTransportInterceptor 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/connectionmonitors_server.go b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go index 59c56f2e2c88..ae25c8df2d9e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectionmonitors_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -28,7 +25,7 @@ type ConnectionMonitorsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters armnetwork.ConnectionMonitor, options *armnetwork.ConnectionMonitorsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ConnectionMonitorsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ConnectionMonitorsClient.Get @@ -39,16 +36,8 @@ type ConnectionMonitorsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListPager func(resourceGroupName string, networkWatcherName string, options *armnetwork.ConnectionMonitorsClientListOptions) (resp azfake.PagerResponder[armnetwork.ConnectionMonitorsClientListResponse]) - // BeginQuery is the fake for method ConnectionMonitorsClient.BeginQuery - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginQuery func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginQueryOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientQueryResponse], errResp azfake.ErrorResponder) - - // BeginStart is the fake for method ConnectionMonitorsClient.BeginStart - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginStart func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginStartOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStartResponse], errResp azfake.ErrorResponder) - // BeginStop is the fake for method ConnectionMonitorsClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, options *armnetwork.ConnectionMonitorsClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStopResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method ConnectionMonitorsClient.UpdateTags @@ -65,8 +54,6 @@ func NewConnectionMonitorsServerTransport(srv *ConnectionMonitorsServer) *Connec beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armnetwork.ConnectionMonitorsClientListResponse]](), - beginQuery: newTracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientQueryResponse]](), - beginStart: newTracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStartResponse]](), beginStop: newTracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStopResponse]](), } } @@ -78,8 +65,6 @@ type ConnectionMonitorsServerTransport struct { beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armnetwork.ConnectionMonitorsClientListResponse]] - beginQuery *tracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientQueryResponse]] - beginStart *tracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStartResponse]] beginStop *tracker[azfake.PollerResponder[armnetwork.ConnectionMonitorsClientStopResponse]] } @@ -91,35 +76,50 @@ func (c *ConnectionMonitorsServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ConnectionMonitorsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConnectionMonitorsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ConnectionMonitorsClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectionMonitorsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ConnectionMonitorsClient.BeginQuery": - resp, err = c.dispatchBeginQuery(req) - case "ConnectionMonitorsClient.BeginStart": - resp, err = c.dispatchBeginStart(req) - case "ConnectionMonitorsClient.BeginStop": - resp, err = c.dispatchBeginStop(req) - case "ConnectionMonitorsClient.UpdateTags": - resp, err = c.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (c *ConnectionMonitorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if connectionMonitorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectionMonitorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectionMonitorsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConnectionMonitorsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ConnectionMonitorsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectionMonitorsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "ConnectionMonitorsClient.BeginStop": + res.resp, res.err = c.dispatchBeginStop(req) + case "ConnectionMonitorsClient.UpdateTags": + res.resp, res.err = c.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectionMonitorsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -223,9 +223,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + 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) @@ -309,102 +309,6 @@ func (c *ConnectionMonitorsServerTransport) dispatchNewListPager(req *http.Reque return resp, nil } -func (c *ConnectionMonitorsServerTransport) dispatchBeginQuery(req *http.Request) (*http.Response, error) { - if c.srv.BeginQuery == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginQuery not implemented")} - } - beginQuery := c.beginQuery.get(req) - if beginQuery == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkWatchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionMonitors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/query` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || 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 - } - networkWatcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkWatcherName")]) - if err != nil { - return nil, err - } - connectionMonitorNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionMonitorName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginQuery(req.Context(), resourceGroupNameParam, networkWatcherNameParam, connectionMonitorNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginQuery = &respr - c.beginQuery.add(req, beginQuery) - } - - resp, err := server.PollerResponderNext(beginQuery, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginQuery.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginQuery) { - c.beginQuery.remove(req) - } - - return resp, nil -} - -func (c *ConnectionMonitorsServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { - if c.srv.BeginStart == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} - } - beginStart := c.beginStart.get(req) - if beginStart == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkWatchers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectionMonitors/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || 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 - } - networkWatcherNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkWatcherName")]) - if err != nil { - return nil, err - } - connectionMonitorNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectionMonitorName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginStart(req.Context(), resourceGroupNameParam, networkWatcherNameParam, connectionMonitorNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginStart = &respr - c.beginStart.add(req, beginStart) - } - - resp, err := server.PollerResponderNext(beginStart, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginStart) { - c.beginStart.remove(req) - } - - return resp, nil -} - func (c *ConnectionMonitorsServerTransport) dispatchBeginStop(req *http.Request) (*http.Response, error) { if c.srv.BeginStop == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStop not implemented")} @@ -442,9 +346,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchBeginStop(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { c.beginStop.remove(req) @@ -493,3 +397,9 @@ func (c *ConnectionMonitorsServerTransport) dispatchUpdateTags(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectionMonitorsServerTransport +var connectionMonitorsServerTransportInterceptor 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 1d535e2624bb..915156033e17 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/connectivityconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (c *ConnectivityConfigurationsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectivityConfigurationsClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectivityConfigurationsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ConnectivityConfigurationsClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectivityConfigurationsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectivityConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectivityConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectivityConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectivityConfigurationsClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectivityConfigurationsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ConnectivityConfigurationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectivityConfigurationsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectivityConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -300,3 +316,9 @@ func (c *ConnectivityConfigurationsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectivityConfigurationsServerTransport +var connectivityConfigurationsServerTransportInterceptor 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/customipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go index 09fee8114eb9..dbabfff9f93b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/customipprefixes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (c *CustomIPPrefixesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CustomIPPrefixesClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "CustomIPPrefixesClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CustomIPPrefixesClient.Get": - resp, err = c.dispatchGet(req) - case "CustomIPPrefixesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "CustomIPPrefixesClient.NewListAllPager": - resp, err = c.dispatchNewListAllPager(req) - case "CustomIPPrefixesClient.UpdateTags": - resp, err = c.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CustomIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if customIPPrefixesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customIPPrefixesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomIPPrefixesClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CustomIPPrefixesClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CustomIPPrefixesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomIPPrefixesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "CustomIPPrefixesClient.NewListAllPager": + res.resp, res.err = c.dispatchNewListAllPager(req) + case "CustomIPPrefixesClient.UpdateTags": + res.resp, res.err = c.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CustomIPPrefixesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (c *CustomIPPrefixesServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to CustomIPPrefixesServerTransport +var customIPPrefixesServerTransportInterceptor 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/ddoscustompolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go index 9cf7492b8767..b76395c01ed4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddoscustompolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (d *DdosCustomPoliciesServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DdosCustomPoliciesClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DdosCustomPoliciesClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DdosCustomPoliciesClient.Get": - resp, err = d.dispatchGet(req) - case "DdosCustomPoliciesClient.UpdateTags": - resp, err = d.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DdosCustomPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ddosCustomPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ddosCustomPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DdosCustomPoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DdosCustomPoliciesClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DdosCustomPoliciesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DdosCustomPoliciesClient.UpdateTags": + res.resp, res.err = d.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DdosCustomPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -251,3 +267,9 @@ func (d *DdosCustomPoliciesServerTransport) dispatchUpdateTags(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to DdosCustomPoliciesServerTransport +var ddosCustomPoliciesServerTransportInterceptor 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/ddosprotectionplans_server.go b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go index ab016c4c4c86..a01c239348eb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ddosprotectionplans_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (d *DdosProtectionPlansServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DdosProtectionPlansClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DdosProtectionPlansClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DdosProtectionPlansClient.Get": - resp, err = d.dispatchGet(req) - case "DdosProtectionPlansClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DdosProtectionPlansClient.NewListByResourceGroupPager": - resp, err = d.dispatchNewListByResourceGroupPager(req) - case "DdosProtectionPlansClient.UpdateTags": - resp, err = d.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DdosProtectionPlansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ddosProtectionPlansServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ddosProtectionPlansServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DdosProtectionPlansClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DdosProtectionPlansClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DdosProtectionPlansClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DdosProtectionPlansClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DdosProtectionPlansClient.NewListByResourceGroupPager": + res.resp, res.err = d.dispatchNewListByResourceGroupPager(req) + case "DdosProtectionPlansClient.UpdateTags": + res.resp, res.err = d.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DdosProtectionPlansServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (d *DdosProtectionPlansServerTransport) dispatchUpdateTags(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to DdosProtectionPlansServerTransport +var ddosProtectionPlansServerTransportInterceptor 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/defaultsecurityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go index 98630d27bd4e..9c46a54b54d5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/defaultsecurityrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (d *DefaultSecurityRulesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DefaultSecurityRulesClient.Get": - resp, err = d.dispatchGet(req) - case "DefaultSecurityRulesClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DefaultSecurityRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if defaultSecurityRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = defaultSecurityRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DefaultSecurityRulesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DefaultSecurityRulesClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DefaultSecurityRulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (d *DefaultSecurityRulesServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to DefaultSecurityRulesServerTransport +var defaultSecurityRulesServerTransportInterceptor 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/dscpconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go index 9351f97323ca..7fdc9147c35b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/dscpconfiguration_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (d *DscpConfigurationServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DscpConfigurationClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DscpConfigurationClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DscpConfigurationClient.Get": - resp, err = d.dispatchGet(req) - case "DscpConfigurationClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DscpConfigurationClient.NewListAllPager": - resp, err = d.dispatchNewListAllPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DscpConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dscpConfigurationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dscpConfigurationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DscpConfigurationClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DscpConfigurationClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DscpConfigurationClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DscpConfigurationClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DscpConfigurationClient.NewListAllPager": + res.resp, res.err = d.dispatchNewListAllPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DscpConfigurationServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -295,3 +311,9 @@ func (d *DscpConfigurationServerTransport) dispatchNewListAllPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to DscpConfigurationServerTransport +var dscpConfigurationServerTransportInterceptor 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/expressroutecircuitauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go index 842dddaf68df..827c17b9dca3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitauthorizations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCircuitAuthorizationsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteCircuitAuthorizationsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCircuitAuthorizationsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteCircuitAuthorizationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCircuitAuthorizationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCircuitAuthorizationsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteCircuitAuthorizationsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCircuitAuthorizationsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (e *ExpressRouteCircuitAuthorizationsServerTransport) dispatchNewListPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCircuitAuthorizationsServerTransport +var expressRouteCircuitAuthorizationsServerTransportInterceptor 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/expressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go index 6cb6a801b00d..f0ada4790a49 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCircuitConnectionsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteCircuitConnectionsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCircuitConnectionsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteCircuitConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCircuitConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCircuitConnectionsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteCircuitConnectionsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCircuitConnectionsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -286,3 +302,9 @@ func (e *ExpressRouteCircuitConnectionsServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCircuitConnectionsServerTransport +var expressRouteCircuitConnectionsServerTransportInterceptor 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/expressroutecircuitpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go index 0bfcb07d5aba..a5f6a879b89b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuitpeerings_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCircuitPeeringsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteCircuitPeeringsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCircuitPeeringsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteCircuitPeeringsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCircuitPeeringsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCircuitPeeringsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteCircuitPeeringsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCircuitPeeringsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (e *ExpressRouteCircuitPeeringsServerTransport) dispatchNewListPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCircuitPeeringsServerTransport +var expressRouteCircuitPeeringsServerTransportInterceptor 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/expressroutecircuits_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go index 6aa0d91e85ad..b3a81113adef 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecircuits_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -106,41 +103,60 @@ func (e *ExpressRouteCircuitsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ExpressRouteCircuitsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCircuitsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteCircuitsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCircuitsClient.GetPeeringStats": - resp, err = e.dispatchGetPeeringStats(req) - case "ExpressRouteCircuitsClient.GetStats": - resp, err = e.dispatchGetStats(req) - case "ExpressRouteCircuitsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - case "ExpressRouteCircuitsClient.NewListAllPager": - resp, err = e.dispatchNewListAllPager(req) - case "ExpressRouteCircuitsClient.BeginListArpTable": - resp, err = e.dispatchBeginListArpTable(req) - case "ExpressRouteCircuitsClient.BeginListRoutesTable": - resp, err = e.dispatchBeginListRoutesTable(req) - case "ExpressRouteCircuitsClient.BeginListRoutesTableSummary": - resp, err = e.dispatchBeginListRoutesTableSummary(req) - case "ExpressRouteCircuitsClient.UpdateTags": - resp, err = e.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return e.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (e *ExpressRouteCircuitsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if expressRouteCircuitsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCircuitsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCircuitsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCircuitsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteCircuitsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCircuitsClient.GetPeeringStats": + res.resp, res.err = e.dispatchGetPeeringStats(req) + case "ExpressRouteCircuitsClient.GetStats": + res.resp, res.err = e.dispatchGetStats(req) + case "ExpressRouteCircuitsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + case "ExpressRouteCircuitsClient.NewListAllPager": + res.resp, res.err = e.dispatchNewListAllPager(req) + case "ExpressRouteCircuitsClient.BeginListArpTable": + res.resp, res.err = e.dispatchBeginListArpTable(req) + case "ExpressRouteCircuitsClient.BeginListRoutesTable": + res.resp, res.err = e.dispatchBeginListRoutesTable(req) + case "ExpressRouteCircuitsClient.BeginListRoutesTableSummary": + res.resp, res.err = e.dispatchBeginListRoutesTableSummary(req) + case "ExpressRouteCircuitsClient.UpdateTags": + res.resp, res.err = e.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCircuitsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -600,3 +616,9 @@ func (e *ExpressRouteCircuitsServerTransport) dispatchUpdateTags(req *http.Reque } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCircuitsServerTransport +var expressRouteCircuitsServerTransportInterceptor 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/expressrouteconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go index 634de74077c7..15711f07b0da 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (e *ExpressRouteConnectionsServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteConnectionsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteConnectionsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteConnectionsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteConnectionsClient.List": - resp, err = e.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteConnectionsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteConnectionsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteConnectionsClient.List": + res.resp, res.err = e.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -259,3 +275,9 @@ func (e *ExpressRouteConnectionsServerTransport) dispatchList(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteConnectionsServerTransport +var expressRouteConnectionsServerTransportInterceptor 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/expressroutecrossconnectionpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go index 7c8e458f0903..57d8e800d3c5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnectionpeerings_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) Do(req *http.Reques return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCrossConnectionPeeringsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteCrossConnectionPeeringsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCrossConnectionPeeringsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteCrossConnectionPeeringsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCrossConnectionPeeringsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCrossConnectionPeeringsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteCrossConnectionPeeringsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCrossConnectionPeeringsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (e *ExpressRouteCrossConnectionPeeringsServerTransport) dispatchNewListPage } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCrossConnectionPeeringsServerTransport +var expressRouteCrossConnectionPeeringsServerTransportInterceptor 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/expressroutecrossconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go index 27d87890c326..397fdbf0f2d4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutecrossconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -92,35 +89,54 @@ func (e *ExpressRouteCrossConnectionsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteCrossConnectionsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteCrossConnectionsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - case "ExpressRouteCrossConnectionsClient.BeginListArpTable": - resp, err = e.dispatchBeginListArpTable(req) - case "ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager": - resp, err = e.dispatchNewListByResourceGroupPager(req) - case "ExpressRouteCrossConnectionsClient.BeginListRoutesTable": - resp, err = e.dispatchBeginListRoutesTable(req) - case "ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary": - resp, err = e.dispatchBeginListRoutesTableSummary(req) - case "ExpressRouteCrossConnectionsClient.UpdateTags": - resp, err = e.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return e.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (e *ExpressRouteCrossConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if expressRouteCrossConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteCrossConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteCrossConnectionsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteCrossConnectionsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + case "ExpressRouteCrossConnectionsClient.BeginListArpTable": + res.resp, res.err = e.dispatchBeginListArpTable(req) + case "ExpressRouteCrossConnectionsClient.NewListByResourceGroupPager": + res.resp, res.err = e.dispatchNewListByResourceGroupPager(req) + case "ExpressRouteCrossConnectionsClient.BeginListRoutesTable": + res.resp, res.err = e.dispatchBeginListRoutesTable(req) + case "ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary": + res.resp, res.err = e.dispatchBeginListRoutesTableSummary(req) + case "ExpressRouteCrossConnectionsClient.UpdateTags": + res.resp, res.err = e.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteCrossConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -478,3 +494,9 @@ func (e *ExpressRouteCrossConnectionsServerTransport) dispatchUpdateTags(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteCrossConnectionsServerTransport +var expressRouteCrossConnectionsServerTransportInterceptor 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/expressroutegateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go index ff1d8b35635e..e9bff5686f81 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutegateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -77,31 +74,50 @@ func (e *ExpressRouteGatewaysServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteGatewaysClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRouteGatewaysClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRouteGatewaysClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteGatewaysClient.ListByResourceGroup": - resp, err = e.dispatchListByResourceGroup(req) - case "ExpressRouteGatewaysClient.ListBySubscription": - resp, err = e.dispatchListBySubscription(req) - case "ExpressRouteGatewaysClient.BeginUpdateTags": - resp, err = e.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRouteGatewaysClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRouteGatewaysClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteGatewaysClient.ListByResourceGroup": + res.resp, res.err = e.dispatchListByResourceGroup(req) + case "ExpressRouteGatewaysClient.ListBySubscription": + res.resp, res.err = e.dispatchListBySubscription(req) + case "ExpressRouteGatewaysClient.BeginUpdateTags": + res.resp, res.err = e.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -330,3 +346,9 @@ func (e *ExpressRouteGatewaysServerTransport) dispatchBeginUpdateTags(req *http. return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteGatewaysServerTransport +var expressRouteGatewaysServerTransportInterceptor 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/expressroutelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go index 319fc4052783..2f7647dba317 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressroutelinks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (e *ExpressRouteLinksServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteLinksClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRouteLinksClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteLinksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteLinksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteLinksClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRouteLinksClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteLinksServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (e *ExpressRouteLinksServerTransport) dispatchNewListPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteLinksServerTransport +var expressRouteLinksServerTransportInterceptor 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/expressrouteportauthorizations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go index 7e41c8265d3f..26bbad98edd2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportauthorizations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRoutePortAuthorizationsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRoutePortAuthorizationsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRoutePortAuthorizationsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRoutePortAuthorizationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRoutePortAuthorizationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRoutePortAuthorizationsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRoutePortAuthorizationsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRoutePortAuthorizationsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (e *ExpressRoutePortAuthorizationsServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRoutePortAuthorizationsServerTransport +var expressRoutePortAuthorizationsServerTransportInterceptor 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/expressrouteports_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go index 48de481fc565..9ac5d82ed361 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteports_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -84,33 +81,52 @@ func (e *ExpressRoutePortsServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRoutePortsClient.BeginCreateOrUpdate": - resp, err = e.dispatchBeginCreateOrUpdate(req) - case "ExpressRoutePortsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "ExpressRoutePortsClient.GenerateLOA": - resp, err = e.dispatchGenerateLOA(req) - case "ExpressRoutePortsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRoutePortsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - case "ExpressRoutePortsClient.NewListByResourceGroupPager": - resp, err = e.dispatchNewListByResourceGroupPager(req) - case "ExpressRoutePortsClient.UpdateTags": - resp, err = e.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRoutePortsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRoutePortsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRoutePortsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRoutePortsClient.BeginCreateOrUpdate": + res.resp, res.err = e.dispatchBeginCreateOrUpdate(req) + case "ExpressRoutePortsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "ExpressRoutePortsClient.GenerateLOA": + res.resp, res.err = e.dispatchGenerateLOA(req) + case "ExpressRoutePortsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRoutePortsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + case "ExpressRoutePortsClient.NewListByResourceGroupPager": + res.resp, res.err = e.dispatchNewListByResourceGroupPager(req) + case "ExpressRoutePortsClient.UpdateTags": + res.resp, res.err = e.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRoutePortsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -381,3 +397,9 @@ func (e *ExpressRoutePortsServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRoutePortsServerTransport +var expressRoutePortsServerTransportInterceptor 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/expressrouteportslocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go index fbda48d5d293..d9d052a1901f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteportslocations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (e *ExpressRoutePortsLocationsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRoutePortsLocationsClient.Get": - resp, err = e.dispatchGet(req) - case "ExpressRoutePortsLocationsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRoutePortsLocationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRoutePortsLocationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRoutePortsLocationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRoutePortsLocationsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExpressRoutePortsLocationsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRoutePortsLocationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -138,3 +154,9 @@ func (e *ExpressRoutePortsLocationsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRoutePortsLocationsServerTransport +var expressRoutePortsLocationsServerTransportInterceptor 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/expressrouteproviderportslocation_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go index 5c7fca6dbb9d..97c8655f5ae1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteproviderportslocation_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteProviderPortsLocationClient.List": - resp, err = e.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteProviderPortsLocationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteProviderPortsLocationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteProviderPortsLocationClient.List": + res.resp, res.err = e.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (e *ExpressRouteProviderPortsLocationServerTransport) dispatchList(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteProviderPortsLocationServerTransport +var expressRouteProviderPortsLocationServerTransportInterceptor 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/expressrouteserviceproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go index cbe8b098e38d..4bd48dde9b29 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/expressrouteserviceproviders_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "regexp" ) @@ -52,21 +49,40 @@ func (e *ExpressRouteServiceProvidersServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExpressRouteServiceProvidersClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExpressRouteServiceProvidersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if expressRouteServiceProvidersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = expressRouteServiceProvidersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExpressRouteServiceProvidersClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExpressRouteServiceProvidersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (e *ExpressRouteServiceProvidersServerTransport) dispatchNewListPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to ExpressRouteServiceProvidersServerTransport +var expressRouteServiceProvidersServerTransportInterceptor 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/firewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go index 726ae1c9aaa5..f66e12841a46 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (f *FirewallPoliciesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallPoliciesClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FirewallPoliciesClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FirewallPoliciesClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallPoliciesClient.NewListPager": - resp, err = f.dispatchNewListPager(req) - case "FirewallPoliciesClient.NewListAllPager": - resp, err = f.dispatchNewListAllPager(req) - case "FirewallPoliciesClient.UpdateTags": - resp, err = f.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FirewallPoliciesClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FirewallPoliciesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallPoliciesClient.NewListPager": + res.resp, res.err = f.dispatchNewListPager(req) + case "FirewallPoliciesClient.NewListAllPager": + res.resp, res.err = f.dispatchNewListAllPager(req) + case "FirewallPoliciesClient.UpdateTags": + res.resp, res.err = f.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (f *FirewallPoliciesServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPoliciesServerTransport +var firewallPoliciesServerTransportInterceptor 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/firewallpolicydeployments_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go index abd47170b278..3be08a0b8b8f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydeployments_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -24,7 +21,7 @@ import ( // FirewallPolicyDeploymentsServer is a fake server for instances of the armnetwork.FirewallPolicyDeploymentsClient type. type FirewallPolicyDeploymentsServer struct { // BeginDeploy is the fake for method FirewallPolicyDeploymentsClient.BeginDeploy - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeploy func(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *armnetwork.FirewallPolicyDeploymentsClientBeginDeployOptions) (resp azfake.PollerResponder[armnetwork.FirewallPolicyDeploymentsClientDeployResponse], errResp azfake.ErrorResponder) } @@ -53,21 +50,40 @@ func (f *FirewallPolicyDeploymentsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallPolicyDeploymentsClient.BeginDeploy": - resp, err = f.dispatchBeginDeploy(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallPolicyDeploymentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallPolicyDeploymentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyDeploymentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyDeploymentsClient.BeginDeploy": + res.resp, res.err = f.dispatchBeginDeploy(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallPolicyDeploymentsServerTransport) dispatchBeginDeploy(req *http.Request) (*http.Response, error) { @@ -103,9 +119,9 @@ func (f *FirewallPolicyDeploymentsServerTransport) dispatchBeginDeploy(req *http return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !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.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeploy) { f.beginDeploy.remove(req) @@ -113,3 +129,9 @@ func (f *FirewallPolicyDeploymentsServerTransport) dispatchBeginDeploy(req *http return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyDeploymentsServerTransport +var firewallPolicyDeploymentsServerTransportInterceptor 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/firewallpolicydrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go index b016caed9334..13c33b5b3f52 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicydrafts_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -57,25 +54,44 @@ func (f *FirewallPolicyDraftsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "FirewallPolicyDraftsClient.CreateOrUpdate": - resp, err = f.dispatchCreateOrUpdate(req) - case "FirewallPolicyDraftsClient.Delete": - resp, err = f.dispatchDelete(req) - case "FirewallPolicyDraftsClient.Get": - resp, err = f.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return f.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (f *FirewallPolicyDraftsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if firewallPolicyDraftsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyDraftsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyDraftsClient.CreateOrUpdate": + res.resp, res.err = f.dispatchCreateOrUpdate(req) + case "FirewallPolicyDraftsClient.Delete": + res.resp, res.err = f.dispatchDelete(req) + case "FirewallPolicyDraftsClient.Get": + res.resp, res.err = f.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (f *FirewallPolicyDraftsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -180,3 +196,9 @@ func (f *FirewallPolicyDraftsServerTransport) dispatchGet(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyDraftsServerTransport +var firewallPolicyDraftsServerTransportInterceptor 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/firewallpolicyidpssignatures_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go index bd0ae1fdab01..26a98f2dcd53 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignatures_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (f *FirewallPolicyIdpsSignaturesServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallPolicyIdpsSignaturesClient.List": - resp, err = f.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallPolicyIdpsSignaturesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyIdpsSignaturesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyIdpsSignaturesClient.List": + res.resp, res.err = f.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (f *FirewallPolicyIdpsSignaturesServerTransport) dispatchList(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyIdpsSignaturesServerTransport +var firewallPolicyIdpsSignaturesServerTransportInterceptor 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/firewallpolicyidpssignaturesfiltervalues_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go index 8e7f877da764..692581bd76d5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesfiltervalues_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) Do(req *http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallPolicyIdpsSignaturesFilterValuesClient.List": - resp, err = f.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallPolicyIdpsSignaturesFilterValuesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyIdpsSignaturesFilterValuesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyIdpsSignaturesFilterValuesClient.List": + res.resp, res.err = f.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (f *FirewallPolicyIdpsSignaturesFilterValuesServerTransport) dispatchList(r } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyIdpsSignaturesFilterValuesServerTransport +var firewallPolicyIdpsSignaturesFilterValuesServerTransportInterceptor 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/firewallpolicyidpssignaturesoverrides_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go index 65182b3c494b..8d17e6a12c20 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyidpssignaturesoverrides_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -61,27 +58,46 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) Do(req *http.Requ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "FirewallPolicyIdpsSignaturesOverridesClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallPolicyIdpsSignaturesOverridesClient.List": - resp, err = f.dispatchList(req) - case "FirewallPolicyIdpsSignaturesOverridesClient.Patch": - resp, err = f.dispatchPatch(req) - case "FirewallPolicyIdpsSignaturesOverridesClient.Put": - resp, err = f.dispatchPut(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return f.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if firewallPolicyIdpsSignaturesOverridesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyIdpsSignaturesOverridesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyIdpsSignaturesOverridesClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallPolicyIdpsSignaturesOverridesClient.List": + res.resp, res.err = f.dispatchList(req) + case "FirewallPolicyIdpsSignaturesOverridesClient.Patch": + res.resp, res.err = f.dispatchPatch(req) + case "FirewallPolicyIdpsSignaturesOverridesClient.Put": + res.resp, res.err = f.dispatchPut(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -223,3 +239,9 @@ func (f *FirewallPolicyIdpsSignaturesOverridesServerTransport) dispatchPut(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyIdpsSignaturesOverridesServerTransport +var firewallPolicyIdpsSignaturesOverridesServerTransportInterceptor 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/firewallpolicyrulecollectiongroupdrafts_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go index 8a5a7ecf8d0e..dad24d5f41fa 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroupdrafts_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -57,25 +54,44 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) Do(req *http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "FirewallPolicyRuleCollectionGroupDraftsClient.CreateOrUpdate": - resp, err = f.dispatchCreateOrUpdate(req) - case "FirewallPolicyRuleCollectionGroupDraftsClient.Delete": - resp, err = f.dispatchDelete(req) - case "FirewallPolicyRuleCollectionGroupDraftsClient.Get": - resp, err = f.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return f.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if firewallPolicyRuleCollectionGroupDraftsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyRuleCollectionGroupDraftsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyRuleCollectionGroupDraftsClient.CreateOrUpdate": + res.resp, res.err = f.dispatchCreateOrUpdate(req) + case "FirewallPolicyRuleCollectionGroupDraftsClient.Delete": + res.resp, res.err = f.dispatchDelete(req) + case "FirewallPolicyRuleCollectionGroupDraftsClient.Get": + res.resp, res.err = f.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -192,3 +208,9 @@ func (f *FirewallPolicyRuleCollectionGroupDraftsServerTransport) dispatchGet(req } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyRuleCollectionGroupDraftsServerTransport +var firewallPolicyRuleCollectionGroupDraftsServerTransportInterceptor 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/firewallpolicyrulecollectiongroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go index 8ba471999491..d401aec6c91c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/firewallpolicyrulecollectiongroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) Do(req *http.Request return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FirewallPolicyRuleCollectionGroupsClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FirewallPolicyRuleCollectionGroupsClient.Get": - resp, err = f.dispatchGet(req) - case "FirewallPolicyRuleCollectionGroupsClient.NewListPager": - resp, err = f.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if firewallPolicyRuleCollectionGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = firewallPolicyRuleCollectionGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FirewallPolicyRuleCollectionGroupsClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FirewallPolicyRuleCollectionGroupsClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FirewallPolicyRuleCollectionGroupsClient.NewListPager": + res.resp, res.err = f.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (f *FirewallPolicyRuleCollectionGroupsServerTransport) dispatchNewListPager } return resp, nil } + +// set this to conditionally intercept incoming requests to FirewallPolicyRuleCollectionGroupsServerTransport +var firewallPolicyRuleCollectionGroupsServerTransportInterceptor 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/flowlogs_server.go b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go index 462cafd68d39..dc045caffb61 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/flowlogs_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type FlowLogsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters armnetwork.FlowLog, options *armnetwork.FlowLogsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.FlowLogsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method FlowLogsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, options *armnetwork.FlowLogsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.FlowLogsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method FlowLogsClient.Get @@ -74,29 +71,48 @@ func (f *FlowLogsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return f.dispatchToMethodFake(req, method) +} - switch method { - case "FlowLogsClient.BeginCreateOrUpdate": - resp, err = f.dispatchBeginCreateOrUpdate(req) - case "FlowLogsClient.BeginDelete": - resp, err = f.dispatchBeginDelete(req) - case "FlowLogsClient.Get": - resp, err = f.dispatchGet(req) - case "FlowLogsClient.NewListPager": - resp, err = f.dispatchNewListPager(req) - case "FlowLogsClient.UpdateTags": - resp, err = f.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (f *FlowLogsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if flowLogsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = flowLogsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "FlowLogsClient.BeginCreateOrUpdate": + res.resp, res.err = f.dispatchBeginCreateOrUpdate(req) + case "FlowLogsClient.BeginDelete": + res.resp, res.err = f.dispatchBeginDelete(req) + case "FlowLogsClient.Get": + res.resp, res.err = f.dispatchGet(req) + case "FlowLogsClient.NewListPager": + res.resp, res.err = f.dispatchNewListPager(req) + case "FlowLogsClient.UpdateTags": + res.resp, res.err = f.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (f *FlowLogsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -188,9 +204,9 @@ func (f *FlowLogsServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { f.beginDelete.remove(req) @@ -317,3 +333,9 @@ func (f *FlowLogsServerTransport) dispatchUpdateTags(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to FlowLogsServerTransport +var flowLogsServerTransportInterceptor 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/groups_server.go b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go index 8d59d40f9644..2480ede858a1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/groups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/groups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (g *GroupsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GroupsClient.CreateOrUpdate": - resp, err = g.dispatchCreateOrUpdate(req) - case "GroupsClient.BeginDelete": - resp, err = g.dispatchBeginDelete(req) - case "GroupsClient.Get": - resp, err = g.dispatchGet(req) - case "GroupsClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if groupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = groupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GroupsClient.CreateOrUpdate": + res.resp, res.err = g.dispatchCreateOrUpdate(req) + case "GroupsClient.BeginDelete": + res.resp, res.err = g.dispatchBeginDelete(req) + case "GroupsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GroupsClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -310,3 +326,9 @@ func (g *GroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to GroupsServerTransport +var groupsServerTransportInterceptor 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/hubroutetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go index 24709c26eb14..1092816c2362 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubroutetables_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (h *HubRouteTablesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return h.dispatchToMethodFake(req, method) +} - switch method { - case "HubRouteTablesClient.BeginCreateOrUpdate": - resp, err = h.dispatchBeginCreateOrUpdate(req) - case "HubRouteTablesClient.BeginDelete": - resp, err = h.dispatchBeginDelete(req) - case "HubRouteTablesClient.Get": - resp, err = h.dispatchGet(req) - case "HubRouteTablesClient.NewListPager": - resp, err = h.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (h *HubRouteTablesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if hubRouteTablesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = hubRouteTablesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "HubRouteTablesClient.BeginCreateOrUpdate": + res.resp, res.err = h.dispatchBeginCreateOrUpdate(req) + case "HubRouteTablesClient.BeginDelete": + res.resp, res.err = h.dispatchBeginDelete(req) + case "HubRouteTablesClient.Get": + res.resp, res.err = h.dispatchGet(req) + case "HubRouteTablesClient.NewListPager": + res.resp, res.err = h.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (h *HubRouteTablesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (h *HubRouteTablesServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to HubRouteTablesServerTransport +var hubRouteTablesServerTransportInterceptor 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/hubvirtualnetworkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go index 6c888d0a46e2..c17bc8515dae 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/hubvirtualnetworkconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (h *HubVirtualNetworkConnectionsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return h.dispatchToMethodFake(req, method) +} - switch method { - case "HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate": - resp, err = h.dispatchBeginCreateOrUpdate(req) - case "HubVirtualNetworkConnectionsClient.BeginDelete": - resp, err = h.dispatchBeginDelete(req) - case "HubVirtualNetworkConnectionsClient.Get": - resp, err = h.dispatchGet(req) - case "HubVirtualNetworkConnectionsClient.NewListPager": - resp, err = h.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (h *HubVirtualNetworkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if hubVirtualNetworkConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = hubVirtualNetworkConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = h.dispatchBeginCreateOrUpdate(req) + case "HubVirtualNetworkConnectionsClient.BeginDelete": + res.resp, res.err = h.dispatchBeginDelete(req) + case "HubVirtualNetworkConnectionsClient.Get": + res.resp, res.err = h.dispatchGet(req) + case "HubVirtualNetworkConnectionsClient.NewListPager": + res.resp, res.err = h.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (h *HubVirtualNetworkConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (h *HubVirtualNetworkConnectionsServerTransport) dispatchNewListPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to HubVirtualNetworkConnectionsServerTransport +var hubVirtualNetworkConnectionsServerTransportInterceptor 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/inboundnatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go index aec9371088c8..b3be23ba143c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundnatrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (i *InboundNatRulesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InboundNatRulesClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "InboundNatRulesClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "InboundNatRulesClient.Get": - resp, err = i.dispatchGet(req) - case "InboundNatRulesClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InboundNatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if inboundNatRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = inboundNatRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InboundNatRulesClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "InboundNatRulesClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "InboundNatRulesClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InboundNatRulesClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InboundNatRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -282,3 +298,9 @@ func (i *InboundNatRulesServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to InboundNatRulesServerTransport +var inboundNatRulesServerTransportInterceptor 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/inboundsecurityrule_server.go b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go index 16b0787fcf12..62fd40d330e0 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/inboundsecurityrule_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -57,23 +54,42 @@ func (i *InboundSecurityRuleServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InboundSecurityRuleClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "InboundSecurityRuleClient.Get": - resp, err = i.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InboundSecurityRuleServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if inboundSecurityRuleServerTransportInterceptor != nil { + res.resp, res.err, intercepted = inboundSecurityRuleServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InboundSecurityRuleClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "InboundSecurityRuleClient.Get": + res.resp, res.err = i.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InboundSecurityRuleServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -164,3 +180,9 @@ func (i *InboundSecurityRuleServerTransport) dispatchGet(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to InboundSecurityRuleServerTransport +var inboundSecurityRuleServerTransportInterceptor 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 f5740cfa146b..9f00e16d4285 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceipconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (i *InterfaceIPConfigurationsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InterfaceIPConfigurationsClient.Get": - resp, err = i.dispatchGet(req) - case "InterfaceIPConfigurationsClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InterfaceIPConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if interfaceIPConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = interfaceIPConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InterfaceIPConfigurationsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InterfaceIPConfigurationsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InterfaceIPConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (i *InterfaceIPConfigurationsServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to InterfaceIPConfigurationsServerTransport +var interfaceIPConfigurationsServerTransportInterceptor 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/interfaceloadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go index 23f3dbd7b31a..e2490deda238 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaceloadbalancers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (i *InterfaceLoadBalancersServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InterfaceLoadBalancersClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InterfaceLoadBalancersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if interfaceLoadBalancersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = interfaceLoadBalancersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InterfaceLoadBalancersClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InterfaceLoadBalancersServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -110,3 +126,9 @@ func (i *InterfaceLoadBalancersServerTransport) dispatchNewListPager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to InterfaceLoadBalancersServerTransport +var interfaceLoadBalancersServerTransportInterceptor 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/interfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go index 64bb42c52f09..6230957ec1fc 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfaces_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -134,51 +131,70 @@ func (i *InterfacesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "InterfacesClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "InterfacesClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "InterfacesClient.Get": - resp, err = i.dispatchGet(req) - case "InterfacesClient.GetCloudServiceNetworkInterface": - resp, err = i.dispatchGetCloudServiceNetworkInterface(req) - case "InterfacesClient.BeginGetEffectiveRouteTable": - resp, err = i.dispatchBeginGetEffectiveRouteTable(req) - case "InterfacesClient.GetVirtualMachineScaleSetIPConfiguration": - resp, err = i.dispatchGetVirtualMachineScaleSetIPConfiguration(req) - case "InterfacesClient.GetVirtualMachineScaleSetNetworkInterface": - resp, err = i.dispatchGetVirtualMachineScaleSetNetworkInterface(req) - case "InterfacesClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - case "InterfacesClient.NewListAllPager": - resp, err = i.dispatchNewListAllPager(req) - case "InterfacesClient.NewListCloudServiceNetworkInterfacesPager": - resp, err = i.dispatchNewListCloudServiceNetworkInterfacesPager(req) - case "InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager": - resp, err = i.dispatchNewListCloudServiceRoleInstanceNetworkInterfacesPager(req) - case "InterfacesClient.BeginListEffectiveNetworkSecurityGroups": - resp, err = i.dispatchBeginListEffectiveNetworkSecurityGroups(req) - case "InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager": - resp, err = i.dispatchNewListVirtualMachineScaleSetIPConfigurationsPager(req) - case "InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager": - resp, err = i.dispatchNewListVirtualMachineScaleSetNetworkInterfacesPager(req) - case "InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager": - resp, err = i.dispatchNewListVirtualMachineScaleSetVMNetworkInterfacesPager(req) - case "InterfacesClient.UpdateTags": - resp, err = i.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return i.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (i *InterfacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if interfacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = interfacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InterfacesClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "InterfacesClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "InterfacesClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InterfacesClient.GetCloudServiceNetworkInterface": + res.resp, res.err = i.dispatchGetCloudServiceNetworkInterface(req) + case "InterfacesClient.BeginGetEffectiveRouteTable": + res.resp, res.err = i.dispatchBeginGetEffectiveRouteTable(req) + case "InterfacesClient.GetVirtualMachineScaleSetIPConfiguration": + res.resp, res.err = i.dispatchGetVirtualMachineScaleSetIPConfiguration(req) + case "InterfacesClient.GetVirtualMachineScaleSetNetworkInterface": + res.resp, res.err = i.dispatchGetVirtualMachineScaleSetNetworkInterface(req) + case "InterfacesClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + case "InterfacesClient.NewListAllPager": + res.resp, res.err = i.dispatchNewListAllPager(req) + case "InterfacesClient.NewListCloudServiceNetworkInterfacesPager": + res.resp, res.err = i.dispatchNewListCloudServiceNetworkInterfacesPager(req) + case "InterfacesClient.NewListCloudServiceRoleInstanceNetworkInterfacesPager": + res.resp, res.err = i.dispatchNewListCloudServiceRoleInstanceNetworkInterfacesPager(req) + case "InterfacesClient.BeginListEffectiveNetworkSecurityGroups": + res.resp, res.err = i.dispatchBeginListEffectiveNetworkSecurityGroups(req) + case "InterfacesClient.NewListVirtualMachineScaleSetIPConfigurationsPager": + res.resp, res.err = i.dispatchNewListVirtualMachineScaleSetIPConfigurationsPager(req) + case "InterfacesClient.NewListVirtualMachineScaleSetNetworkInterfacesPager": + res.resp, res.err = i.dispatchNewListVirtualMachineScaleSetNetworkInterfacesPager(req) + case "InterfacesClient.NewListVirtualMachineScaleSetVMNetworkInterfacesPager": + res.resp, res.err = i.dispatchNewListVirtualMachineScaleSetVMNetworkInterfacesPager(req) + case "InterfacesClient.UpdateTags": + res.resp, res.err = i.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InterfacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -908,3 +924,9 @@ func (i *InterfacesServerTransport) dispatchUpdateTags(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to InterfacesServerTransport +var interfacesServerTransportInterceptor 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/interfacetapconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go index 92ea98817f58..34c805a42ebf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/interfacetapconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (i *InterfaceTapConfigurationsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InterfaceTapConfigurationsClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "InterfaceTapConfigurationsClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "InterfaceTapConfigurationsClient.Get": - resp, err = i.dispatchGet(req) - case "InterfaceTapConfigurationsClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InterfaceTapConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if interfaceTapConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = interfaceTapConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InterfaceTapConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "InterfaceTapConfigurationsClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "InterfaceTapConfigurationsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InterfaceTapConfigurationsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InterfaceTapConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (i *InterfaceTapConfigurationsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to InterfaceTapConfigurationsServerTransport +var interfaceTapConfigurationsServerTransportInterceptor 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/internal.go b/sdk/resourcemanager/network/armnetwork/fake/internal.go index e0173df3faef..6c584d9b9549 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/internal.go +++ b/sdk/resourcemanager/network/armnetwork/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,6 +13,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go index ebccd5a14792..8f1ba36262ea 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipallocations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (i *IPAllocationsServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IPAllocationsClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "IPAllocationsClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "IPAllocationsClient.Get": - resp, err = i.dispatchGet(req) - case "IPAllocationsClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - case "IPAllocationsClient.NewListByResourceGroupPager": - resp, err = i.dispatchNewListByResourceGroupPager(req) - case "IPAllocationsClient.UpdateTags": - resp, err = i.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IPAllocationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ipAllocationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ipAllocationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IPAllocationsClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "IPAllocationsClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "IPAllocationsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IPAllocationsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + case "IPAllocationsClient.NewListByResourceGroupPager": + res.resp, res.err = i.dispatchNewListByResourceGroupPager(req) + case "IPAllocationsClient.UpdateTags": + res.resp, res.err = i.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IPAllocationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (i *IPAllocationsServerTransport) dispatchUpdateTags(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to IPAllocationsServerTransport +var ipAllocationsServerTransportInterceptor 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/ipampools_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go index f854fd983951..ae04079b4a04 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipampools_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -31,7 +28,7 @@ type IpamPoolsServer struct { BeginCreate func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body armnetwork.IpamPool, options *armnetwork.IpamPoolsClientBeginCreateOptions) (resp azfake.PollerResponder[armnetwork.IpamPoolsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method IpamPoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *armnetwork.IpamPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.IpamPoolsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method IpamPoolsClient.Get @@ -86,33 +83,52 @@ func (i *IpamPoolsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IpamPoolsClient.BeginCreate": - resp, err = i.dispatchBeginCreate(req) - case "IpamPoolsClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "IpamPoolsClient.Get": - resp, err = i.dispatchGet(req) - case "IpamPoolsClient.GetPoolUsage": - resp, err = i.dispatchGetPoolUsage(req) - case "IpamPoolsClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - case "IpamPoolsClient.NewListAssociatedResourcesPager": - resp, err = i.dispatchNewListAssociatedResourcesPager(req) - case "IpamPoolsClient.Update": - resp, err = i.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IpamPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ipamPoolsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ipamPoolsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IpamPoolsClient.BeginCreate": + res.resp, res.err = i.dispatchBeginCreate(req) + case "IpamPoolsClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "IpamPoolsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IpamPoolsClient.GetPoolUsage": + res.resp, res.err = i.dispatchGetPoolUsage(req) + case "IpamPoolsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + case "IpamPoolsClient.NewListAssociatedResourcesPager": + res.resp, res.err = i.dispatchNewListAssociatedResourcesPager(req) + case "IpamPoolsClient.Update": + res.resp, res.err = i.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IpamPoolsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -204,9 +220,9 @@ func (i *IpamPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { i.beginDelete.remove(req) @@ -475,3 +491,9 @@ func (i *IpamPoolsServerTransport) dispatchUpdate(req *http.Request) (*http.Resp } return resp, nil } + +// set this to conditionally intercept incoming requests to IpamPoolsServerTransport +var ipamPoolsServerTransportInterceptor 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/ipgroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go index f6727e4b0d9e..d35e14697f53 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/ipgroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (i *IPGroupsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IPGroupsClient.BeginCreateOrUpdate": - resp, err = i.dispatchBeginCreateOrUpdate(req) - case "IPGroupsClient.BeginDelete": - resp, err = i.dispatchBeginDelete(req) - case "IPGroupsClient.Get": - resp, err = i.dispatchGet(req) - case "IPGroupsClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - case "IPGroupsClient.NewListByResourceGroupPager": - resp, err = i.dispatchNewListByResourceGroupPager(req) - case "IPGroupsClient.UpdateGroups": - resp, err = i.dispatchUpdateGroups(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IPGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ipGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ipGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IPGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = i.dispatchBeginCreateOrUpdate(req) + case "IPGroupsClient.BeginDelete": + res.resp, res.err = i.dispatchBeginDelete(req) + case "IPGroupsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IPGroupsClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + case "IPGroupsClient.NewListByResourceGroupPager": + res.resp, res.err = i.dispatchNewListByResourceGroupPager(req) + case "IPGroupsClient.UpdateGroups": + res.resp, res.err = i.dispatchUpdateGroups(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IPGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (i *IPGroupsServerTransport) dispatchUpdateGroups(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to IPGroupsServerTransport +var ipGroupsServerTransportInterceptor 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/loadbalancerbackendaddresspools_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go index 6d97365487a3..bcce896d4223 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerbackendaddresspools_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) Do(req *http.Request) ( return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate": - resp, err = l.dispatchBeginCreateOrUpdate(req) - case "LoadBalancerBackendAddressPoolsClient.BeginDelete": - resp, err = l.dispatchBeginDelete(req) - case "LoadBalancerBackendAddressPoolsClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancerBackendAddressPoolsClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerBackendAddressPoolsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerBackendAddressPoolsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate": + res.resp, res.err = l.dispatchBeginCreateOrUpdate(req) + case "LoadBalancerBackendAddressPoolsClient.BeginDelete": + res.resp, res.err = l.dispatchBeginDelete(req) + case "LoadBalancerBackendAddressPoolsClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancerBackendAddressPoolsClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (l *LoadBalancerBackendAddressPoolsServerTransport) dispatchNewListPager(re } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerBackendAddressPoolsServerTransport +var loadBalancerBackendAddressPoolsServerTransportInterceptor 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/loadbalancerfrontendipconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go index 1bbe07878818..f991a58d8623 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerfrontendipconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) Do(req *http.Reque return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerFrontendIPConfigurationsClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancerFrontendIPConfigurationsClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerFrontendIPConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerFrontendIPConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerFrontendIPConfigurationsClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancerFrontendIPConfigurationsClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (l *LoadBalancerFrontendIPConfigurationsServerTransport) dispatchNewListPag } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerFrontendIPConfigurationsServerTransport +var loadBalancerFrontendIPConfigurationsServerTransportInterceptor 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/loadbalancerloadbalancingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go index e1e3f3f437ca..cb2cf1884715 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerloadbalancingrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -64,25 +61,44 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerLoadBalancingRulesClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancerLoadBalancingRulesClient.BeginHealth": - resp, err = l.dispatchBeginHealth(req) - case "LoadBalancerLoadBalancingRulesClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerLoadBalancingRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerLoadBalancingRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerLoadBalancingRulesClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancerLoadBalancingRulesClient.BeginHealth": + res.resp, res.err = l.dispatchBeginHealth(req) + case "LoadBalancerLoadBalancingRulesClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -210,3 +226,9 @@ func (l *LoadBalancerLoadBalancingRulesServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerLoadBalancingRulesServerTransport +var loadBalancerLoadBalancingRulesServerTransportInterceptor 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/loadbalancernetworkinterfaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go index 097da96d2e7d..d401ec93a064 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancernetworkinterfaces_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (l *LoadBalancerNetworkInterfacesServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerNetworkInterfacesClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerNetworkInterfacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerNetworkInterfacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerNetworkInterfacesClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -110,3 +126,9 @@ func (l *LoadBalancerNetworkInterfacesServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerNetworkInterfacesServerTransport +var loadBalancerNetworkInterfacesServerTransportInterceptor 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/loadbalanceroutboundrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go index b6737fdf35f2..e99d839efe4b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalanceroutboundrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (l *LoadBalancerOutboundRulesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerOutboundRulesClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancerOutboundRulesClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerOutboundRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerOutboundRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerOutboundRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerOutboundRulesClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancerOutboundRulesClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerOutboundRulesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (l *LoadBalancerOutboundRulesServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerOutboundRulesServerTransport +var loadBalancerOutboundRulesServerTransportInterceptor 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/loadbalancerprobes_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go index 6b72163b6ee3..c5099dabb2fe 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancerprobes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (l *LoadBalancerProbesServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LoadBalancerProbesClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancerProbesClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LoadBalancerProbesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if loadBalancerProbesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancerProbesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancerProbesClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancerProbesClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancerProbesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (l *LoadBalancerProbesServerTransport) dispatchNewListPager(req *http.Reque } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancerProbesServerTransport +var loadBalancerProbesServerTransportInterceptor 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/loadbalancers_server.go b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go index 4deff2485204..ea8d1ac65cb7 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/loadbalancers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -54,7 +51,7 @@ type LoadBalancersServer struct { MigrateToIPBased func(ctx context.Context, groupName string, loadBalancerName string, options *armnetwork.LoadBalancersClientMigrateToIPBasedOptions) (resp azfake.Responder[armnetwork.LoadBalancersClientMigrateToIPBasedResponse], errResp azfake.ErrorResponder) // BeginSwapPublicIPAddresses is the fake for method LoadBalancersClient.BeginSwapPublicIPAddresses - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginSwapPublicIPAddresses func(ctx context.Context, location string, parameters armnetwork.LoadBalancerVipSwapRequest, options *armnetwork.LoadBalancersClientBeginSwapPublicIPAddressesOptions) (resp azfake.PollerResponder[armnetwork.LoadBalancersClientSwapPublicIPAddressesResponse], errResp azfake.ErrorResponder) // UpdateTags is the fake for method LoadBalancersClient.UpdateTags @@ -97,37 +94,56 @@ func (l *LoadBalancersServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "LoadBalancersClient.BeginCreateOrUpdate": - resp, err = l.dispatchBeginCreateOrUpdate(req) - case "LoadBalancersClient.BeginDelete": - resp, err = l.dispatchBeginDelete(req) - case "LoadBalancersClient.Get": - resp, err = l.dispatchGet(req) - case "LoadBalancersClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - case "LoadBalancersClient.NewListAllPager": - resp, err = l.dispatchNewListAllPager(req) - case "LoadBalancersClient.BeginListInboundNatRulePortMappings": - resp, err = l.dispatchBeginListInboundNatRulePortMappings(req) - case "LoadBalancersClient.MigrateToIPBased": - resp, err = l.dispatchMigrateToIPBased(req) - case "LoadBalancersClient.BeginSwapPublicIPAddresses": - resp, err = l.dispatchBeginSwapPublicIPAddresses(req) - case "LoadBalancersClient.UpdateTags": - resp, err = l.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return l.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (l *LoadBalancersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if loadBalancersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = loadBalancersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LoadBalancersClient.BeginCreateOrUpdate": + res.resp, res.err = l.dispatchBeginCreateOrUpdate(req) + case "LoadBalancersClient.BeginDelete": + res.resp, res.err = l.dispatchBeginDelete(req) + case "LoadBalancersClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LoadBalancersClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + case "LoadBalancersClient.NewListAllPager": + res.resp, res.err = l.dispatchNewListAllPager(req) + case "LoadBalancersClient.BeginListInboundNatRulePortMappings": + res.resp, res.err = l.dispatchBeginListInboundNatRulePortMappings(req) + case "LoadBalancersClient.MigrateToIPBased": + res.resp, res.err = l.dispatchMigrateToIPBased(req) + case "LoadBalancersClient.BeginSwapPublicIPAddresses": + res.resp, res.err = l.dispatchBeginSwapPublicIPAddresses(req) + case "LoadBalancersClient.UpdateTags": + res.resp, res.err = l.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LoadBalancersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -465,9 +481,9 @@ func (l *LoadBalancersServerTransport) dispatchBeginSwapPublicIPAddresses(req *h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginSwapPublicIPAddresses) { l.beginSwapPublicIPAddresses.remove(req) @@ -512,3 +528,9 @@ func (l *LoadBalancersServerTransport) dispatchUpdateTags(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to LoadBalancersServerTransport +var loadBalancersServerTransportInterceptor 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/localnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go index 4879592d7a71..521ed5bfd9f3 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/localnetworkgateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -74,29 +71,48 @@ func (l *LocalNetworkGatewaysServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LocalNetworkGatewaysClient.BeginCreateOrUpdate": - resp, err = l.dispatchBeginCreateOrUpdate(req) - case "LocalNetworkGatewaysClient.BeginDelete": - resp, err = l.dispatchBeginDelete(req) - case "LocalNetworkGatewaysClient.Get": - resp, err = l.dispatchGet(req) - case "LocalNetworkGatewaysClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - case "LocalNetworkGatewaysClient.UpdateTags": - resp, err = l.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LocalNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if localNetworkGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = localNetworkGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LocalNetworkGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = l.dispatchBeginCreateOrUpdate(req) + case "LocalNetworkGatewaysClient.BeginDelete": + res.resp, res.err = l.dispatchBeginDelete(req) + case "LocalNetworkGatewaysClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LocalNetworkGatewaysClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + case "LocalNetworkGatewaysClient.UpdateTags": + res.resp, res.err = l.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LocalNetworkGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -297,3 +313,9 @@ func (l *LocalNetworkGatewaysServerTransport) dispatchUpdateTags(req *http.Reque } return resp, nil } + +// set this to conditionally intercept incoming requests to LocalNetworkGatewaysServerTransport +var localNetworkGatewaysServerTransportInterceptor 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/management_server.go b/sdk/resourcemanager/network/armnetwork/fake/management_server.go index e0ea954dc2ce..ceb8006cf48b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/management_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/management_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -30,11 +27,11 @@ type ManagementServer struct { CheckDNSNameAvailability func(ctx context.Context, location string, domainNameLabel string, options *armnetwork.ManagementClientCheckDNSNameAvailabilityOptions) (resp azfake.Responder[armnetwork.ManagementClientCheckDNSNameAvailabilityResponse], errResp azfake.ErrorResponder) // BeginDeleteBastionShareableLink is the fake for method ManagementClient.BeginDeleteBastionShareableLink - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteBastionShareableLink func(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest armnetwork.BastionShareableLinkListRequest, options *armnetwork.ManagementClientBeginDeleteBastionShareableLinkOptions) (resp azfake.PollerResponder[armnetwork.ManagementClientDeleteBastionShareableLinkResponse], errResp azfake.ErrorResponder) // BeginDeleteBastionShareableLinkByToken is the fake for method ManagementClient.BeginDeleteBastionShareableLinkByToken - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteBastionShareableLinkByToken func(ctx context.Context, resourceGroupName string, bastionHostName string, bslTokenRequest armnetwork.BastionShareableLinkTokenListRequest, options *armnetwork.ManagementClientBeginDeleteBastionShareableLinkByTokenOptions) (resp azfake.PollerResponder[armnetwork.ManagementClientDeleteBastionShareableLinkByTokenResponse], errResp azfake.ErrorResponder) // NewDisconnectActiveSessionsPager is the fake for method ManagementClient.NewDisconnectActiveSessionsPager @@ -119,47 +116,66 @@ func (m *ManagementServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ManagementClient.CheckDNSNameAvailability": - resp, err = m.dispatchCheckDNSNameAvailability(req) - case "ManagementClient.BeginDeleteBastionShareableLink": - resp, err = m.dispatchBeginDeleteBastionShareableLink(req) - case "ManagementClient.BeginDeleteBastionShareableLinkByToken": - resp, err = m.dispatchBeginDeleteBastionShareableLinkByToken(req) - case "ManagementClient.NewDisconnectActiveSessionsPager": - resp, err = m.dispatchNewDisconnectActiveSessionsPager(req) - case "ManagementClient.ExpressRouteProviderPort": - resp, err = m.dispatchExpressRouteProviderPort(req) - case "ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile": - resp, err = m.dispatchBeginGeneratevirtualwanvpnserverconfigurationvpnprofile(req) - case "ManagementClient.BeginGetActiveSessions": - resp, err = m.dispatchBeginGetActiveSessions(req) - case "ManagementClient.NewGetBastionShareableLinkPager": - resp, err = m.dispatchNewGetBastionShareableLinkPager(req) - case "ManagementClient.ListActiveConnectivityConfigurations": - resp, err = m.dispatchListActiveConnectivityConfigurations(req) - case "ManagementClient.ListActiveSecurityAdminRules": - resp, err = m.dispatchListActiveSecurityAdminRules(req) - case "ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations": - resp, err = m.dispatchListNetworkManagerEffectiveConnectivityConfigurations(req) - case "ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules": - resp, err = m.dispatchListNetworkManagerEffectiveSecurityAdminRules(req) - case "ManagementClient.BeginPutBastionShareableLink": - resp, err = m.dispatchBeginPutBastionShareableLink(req) - case "ManagementClient.SupportedSecurityProviders": - resp, err = m.dispatchSupportedSecurityProviders(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return m.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (m *ManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if managementServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managementServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagementClient.CheckDNSNameAvailability": + res.resp, res.err = m.dispatchCheckDNSNameAvailability(req) + case "ManagementClient.BeginDeleteBastionShareableLink": + res.resp, res.err = m.dispatchBeginDeleteBastionShareableLink(req) + case "ManagementClient.BeginDeleteBastionShareableLinkByToken": + res.resp, res.err = m.dispatchBeginDeleteBastionShareableLinkByToken(req) + case "ManagementClient.NewDisconnectActiveSessionsPager": + res.resp, res.err = m.dispatchNewDisconnectActiveSessionsPager(req) + case "ManagementClient.ExpressRouteProviderPort": + res.resp, res.err = m.dispatchExpressRouteProviderPort(req) + case "ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile": + res.resp, res.err = m.dispatchBeginGeneratevirtualwanvpnserverconfigurationvpnprofile(req) + case "ManagementClient.BeginGetActiveSessions": + res.resp, res.err = m.dispatchBeginGetActiveSessions(req) + case "ManagementClient.NewGetBastionShareableLinkPager": + res.resp, res.err = m.dispatchNewGetBastionShareableLinkPager(req) + case "ManagementClient.ListActiveConnectivityConfigurations": + res.resp, res.err = m.dispatchListActiveConnectivityConfigurations(req) + case "ManagementClient.ListActiveSecurityAdminRules": + res.resp, res.err = m.dispatchListActiveSecurityAdminRules(req) + case "ManagementClient.ListNetworkManagerEffectiveConnectivityConfigurations": + res.resp, res.err = m.dispatchListNetworkManagerEffectiveConnectivityConfigurations(req) + case "ManagementClient.ListNetworkManagerEffectiveSecurityAdminRules": + res.resp, res.err = m.dispatchListNetworkManagerEffectiveSecurityAdminRules(req) + case "ManagementClient.BeginPutBastionShareableLink": + res.resp, res.err = m.dispatchBeginPutBastionShareableLink(req) + case "ManagementClient.SupportedSecurityProviders": + res.resp, res.err = m.dispatchSupportedSecurityProviders(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (m *ManagementServerTransport) dispatchCheckDNSNameAvailability(req *http.Request) (*http.Response, error) { @@ -233,9 +249,9 @@ func (m *ManagementServerTransport) dispatchBeginDeleteBastionShareableLink(req return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteBastionShareableLink) { m.beginDeleteBastionShareableLink.remove(req) @@ -281,9 +297,9 @@ func (m *ManagementServerTransport) dispatchBeginDeleteBastionShareableLinkByTok return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !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.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteBastionShareableLinkByToken) { m.beginDeleteBastionShareableLinkByToken.remove(req) @@ -815,3 +831,9 @@ func (m *ManagementServerTransport) dispatchSupportedSecurityProviders(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagementServerTransport +var managementServerTransportInterceptor 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/managementgroupnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go index 10d94f184557..f750bfa66c95 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managementgroupnetworkmanagerconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) Do(req *http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "ManagementGroupNetworkManagerConnectionsClient.Delete": - resp, err = m.dispatchDelete(req) - case "ManagementGroupNetworkManagerConnectionsClient.Get": - resp, err = m.dispatchGet(req) - case "ManagementGroupNetworkManagerConnectionsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managementGroupNetworkManagerConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managementGroupNetworkManagerConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate": + res.resp, res.err = m.dispatchCreateOrUpdate(req) + case "ManagementGroupNetworkManagerConnectionsClient.Delete": + res.resp, res.err = m.dispatchDelete(req) + case "ManagementGroupNetworkManagerConnectionsClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagementGroupNetworkManagerConnectionsClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -256,3 +272,9 @@ func (m *ManagementGroupNetworkManagerConnectionsServerTransport) dispatchNewLis } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagementGroupNetworkManagerConnectionsServerTransport +var managementGroupNetworkManagerConnectionsServerTransportInterceptor 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/managercommits_server.go b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go index 5c3d14a2e2a5..1a03308b7527 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managercommits_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (m *ManagerCommitsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagerCommitsClient.BeginPost": - resp, err = m.dispatchBeginPost(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagerCommitsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managerCommitsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managerCommitsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagerCommitsClient.BeginPost": + res.resp, res.err = m.dispatchBeginPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagerCommitsServerTransport) dispatchBeginPost(req *http.Request) (*http.Response, error) { @@ -117,3 +133,9 @@ func (m *ManagerCommitsServerTransport) dispatchBeginPost(req *http.Request) (*h return resp, nil } + +// set this to conditionally intercept incoming requests to ManagerCommitsServerTransport +var managerCommitsServerTransportInterceptor 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/managerdeploymentstatus_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go index 71bfaf39db56..fa7b4213d073 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerdeploymentstatus_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -50,21 +47,40 @@ func (m *ManagerDeploymentStatusServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagerDeploymentStatusClient.List": - resp, err = m.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagerDeploymentStatusServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managerDeploymentStatusServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managerDeploymentStatusServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagerDeploymentStatusClient.List": + res.resp, res.err = m.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagerDeploymentStatusServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -124,3 +140,9 @@ func (m *ManagerDeploymentStatusServerTransport) dispatchList(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagerDeploymentStatusServerTransport +var managerDeploymentStatusServerTransportInterceptor 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/managerroutingconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go index 69fce16b8d36..5d2f752eb83e 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managerroutingconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (m *ManagerRoutingConfigurationsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagerRoutingConfigurationsClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "ManagerRoutingConfigurationsClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagerRoutingConfigurationsClient.Get": - resp, err = m.dispatchGet(req) - case "ManagerRoutingConfigurationsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagerRoutingConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managerRoutingConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managerRoutingConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagerRoutingConfigurationsClient.CreateOrUpdate": + res.resp, res.err = m.dispatchCreateOrUpdate(req) + case "ManagerRoutingConfigurationsClient.BeginDelete": + res.resp, res.err = m.dispatchBeginDelete(req) + case "ManagerRoutingConfigurationsClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagerRoutingConfigurationsClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagerRoutingConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -300,3 +316,9 @@ func (m *ManagerRoutingConfigurationsServerTransport) dispatchNewListPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagerRoutingConfigurationsServerTransport +var managerRoutingConfigurationsServerTransportInterceptor 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/managers_server.go b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go index 6fad97626e61..b06a9682f5a8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/managers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/managers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -79,31 +76,50 @@ func (m *ManagersServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagersClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "ManagersClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagersClient.Get": - resp, err = m.dispatchGet(req) - case "ManagersClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "ManagersClient.NewListBySubscriptionPager": - resp, err = m.dispatchNewListBySubscriptionPager(req) - case "ManagersClient.Patch": - resp, err = m.dispatchPatch(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagersClient.CreateOrUpdate": + res.resp, res.err = m.dispatchCreateOrUpdate(req) + case "ManagersClient.BeginDelete": + res.resp, res.err = m.dispatchBeginDelete(req) + case "ManagersClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagersClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "ManagersClient.NewListBySubscriptionPager": + res.resp, res.err = m.dispatchNewListBySubscriptionPager(req) + case "ManagersClient.Patch": + res.resp, res.err = m.dispatchPatch(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -395,3 +411,9 @@ func (m *ManagersServerTransport) dispatchPatch(req *http.Request) (*http.Respon } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagersServerTransport +var managersServerTransportInterceptor 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/natgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go index 55d8fe78c800..4bda15545112 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natgateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (n *NatGatewaysServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return n.dispatchToMethodFake(req, method) +} - switch method { - case "NatGatewaysClient.BeginCreateOrUpdate": - resp, err = n.dispatchBeginCreateOrUpdate(req) - case "NatGatewaysClient.BeginDelete": - resp, err = n.dispatchBeginDelete(req) - case "NatGatewaysClient.Get": - resp, err = n.dispatchGet(req) - case "NatGatewaysClient.NewListPager": - resp, err = n.dispatchNewListPager(req) - case "NatGatewaysClient.NewListAllPager": - resp, err = n.dispatchNewListAllPager(req) - case "NatGatewaysClient.UpdateTags": - resp, err = n.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (n *NatGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if natGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = natGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NatGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = n.dispatchBeginCreateOrUpdate(req) + case "NatGatewaysClient.BeginDelete": + res.resp, res.err = n.dispatchBeginDelete(req) + case "NatGatewaysClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NatGatewaysClient.NewListPager": + res.resp, res.err = n.dispatchNewListPager(req) + case "NatGatewaysClient.NewListAllPager": + res.resp, res.err = n.dispatchNewListAllPager(req) + case "NatGatewaysClient.UpdateTags": + res.resp, res.err = n.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NatGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (n *NatGatewaysServerTransport) dispatchUpdateTags(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to NatGatewaysServerTransport +var natGatewaysServerTransportInterceptor 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/natrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go index 81e17c0ee7af..8034d0a14995 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/natrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (n *NatRulesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return n.dispatchToMethodFake(req, method) +} - switch method { - case "NatRulesClient.BeginCreateOrUpdate": - resp, err = n.dispatchBeginCreateOrUpdate(req) - case "NatRulesClient.BeginDelete": - resp, err = n.dispatchBeginDelete(req) - case "NatRulesClient.Get": - resp, err = n.dispatchGet(req) - case "NatRulesClient.NewListByVPNGatewayPager": - resp, err = n.dispatchNewListByVPNGatewayPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (n *NatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if natRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = natRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NatRulesClient.BeginCreateOrUpdate": + res.resp, res.err = n.dispatchBeginCreateOrUpdate(req) + case "NatRulesClient.BeginDelete": + res.resp, res.err = n.dispatchBeginDelete(req) + case "NatRulesClient.Get": + res.resp, res.err = n.dispatchGet(req) + case "NatRulesClient.NewListByVPNGatewayPager": + res.resp, res.err = n.dispatchNewListByVPNGatewayPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NatRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (n *NatRulesServerTransport) dispatchNewListByVPNGatewayPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to NatRulesServerTransport +var natRulesServerTransportInterceptor 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/nspassociationreconcile_server.go b/sdk/resourcemanager/network/armnetwork/fake/nspassociationreconcile_server.go new file mode 100644 index 000000000000..a392c62b25fb --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/nspassociationreconcile_server.go @@ -0,0 +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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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/resourcemanager/network/armnetwork/v7" + "net/http" + "net/url" + "regexp" +) + +// NspAssociationReconcileServer is a fake server for instances of the armnetwork.NspAssociationReconcileClient type. +type NspAssociationReconcileServer struct { + // Post is the fake for method NspAssociationReconcileClient.Post + // HTTP status codes to indicate success: http.StatusOK + Post func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters any, options *armnetwork.NspAssociationReconcileClientPostOptions) (resp azfake.Responder[armnetwork.NspAssociationReconcileClientPostResponse], errResp azfake.ErrorResponder) +} + +// NewNspAssociationReconcileServerTransport creates a new instance of NspAssociationReconcileServerTransport with the provided implementation. +// The returned NspAssociationReconcileServerTransport instance is connected to an instance of armnetwork.NspAssociationReconcileClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNspAssociationReconcileServerTransport(srv *NspAssociationReconcileServer) *NspAssociationReconcileServerTransport { + return &NspAssociationReconcileServerTransport{srv: srv} +} + +// NspAssociationReconcileServerTransport connects instances of armnetwork.NspAssociationReconcileClient to instances of NspAssociationReconcileServer. +// Don't use this type directly, use NewNspAssociationReconcileServerTransport instead. +type NspAssociationReconcileServerTransport struct { + srv *NspAssociationReconcileServer +} + +// Do implements the policy.Transporter interface for NspAssociationReconcileServerTransport. +func (n *NspAssociationReconcileServerTransport) 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 n.dispatchToMethodFake(req, method) +} + +func (n *NspAssociationReconcileServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if nspAssociationReconcileServerTransportInterceptor != nil { + res.resp, res.err, intercepted = nspAssociationReconcileServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NspAssociationReconcileClient.Post": + res.resp, res.err = n.dispatchPost(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (n *NspAssociationReconcileServerTransport) dispatchPost(req *http.Request) (*http.Response, error) { + if n.srv.Post == nil { + return nil, &nonRetriableError{errors.New("fake for method Post not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceAssociations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[any](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Post(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, associationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to NspAssociationReconcileServerTransport +var nspAssociationReconcileServerTransportInterceptor 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/operations_server.go b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go index 1ebaa1bfeae3..dcedcfb53c32 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/operations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" ) @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor 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/p2svpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go index cbb998b78192..128de9f31497 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/p2svpngateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -33,7 +30,7 @@ type P2SVPNGatewaysServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, gatewayName string, options *armnetwork.P2SVPNGatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.P2SVPNGatewaysClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDisconnectP2SVPNConnections is the fake for method P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDisconnectP2SVPNConnections func(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request armnetwork.P2SVPNConnectionRequest, options *armnetwork.P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (resp azfake.PollerResponder[armnetwork.P2SVPNGatewaysClientDisconnectP2SVPNConnectionsResponse], errResp azfake.ErrorResponder) // BeginGenerateVPNProfile is the fake for method P2SVPNGatewaysClient.BeginGenerateVPNProfile @@ -112,41 +109,60 @@ func (p *P2SVPNGatewaysServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "P2SVPNGatewaysClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "P2SVPNGatewaysClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections": - resp, err = p.dispatchBeginDisconnectP2SVPNConnections(req) - case "P2SVPNGatewaysClient.BeginGenerateVPNProfile": - resp, err = p.dispatchBeginGenerateVPNProfile(req) - case "P2SVPNGatewaysClient.Get": - resp, err = p.dispatchGet(req) - case "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth": - resp, err = p.dispatchBeginGetP2SVPNConnectionHealth(req) - case "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed": - resp, err = p.dispatchBeginGetP2SVPNConnectionHealthDetailed(req) - case "P2SVPNGatewaysClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "P2SVPNGatewaysClient.NewListByResourceGroupPager": - resp, err = p.dispatchNewListByResourceGroupPager(req) - case "P2SVPNGatewaysClient.BeginReset": - resp, err = p.dispatchBeginReset(req) - case "P2SVPNGatewaysClient.BeginUpdateTags": - resp, err = p.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return p.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (p *P2SVPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if p2SvpnGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = p2SvpnGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "P2SVPNGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "P2SVPNGatewaysClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections": + res.resp, res.err = p.dispatchBeginDisconnectP2SVPNConnections(req) + case "P2SVPNGatewaysClient.BeginGenerateVPNProfile": + res.resp, res.err = p.dispatchBeginGenerateVPNProfile(req) + case "P2SVPNGatewaysClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth": + res.resp, res.err = p.dispatchBeginGetP2SVPNConnectionHealth(req) + case "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed": + res.resp, res.err = p.dispatchBeginGetP2SVPNConnectionHealthDetailed(req) + case "P2SVPNGatewaysClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "P2SVPNGatewaysClient.NewListByResourceGroupPager": + res.resp, res.err = p.dispatchNewListByResourceGroupPager(req) + case "P2SVPNGatewaysClient.BeginReset": + res.resp, res.err = p.dispatchBeginReset(req) + case "P2SVPNGatewaysClient.BeginUpdateTags": + res.resp, res.err = p.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (p *P2SVPNGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -278,9 +294,9 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginDisconnectP2SVPNConnections return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDisconnectP2SVPNConnections) { p.beginDisconnectP2SVPNConnections.remove(req) @@ -623,3 +639,9 @@ func (p *P2SVPNGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Reques return resp, nil } + +// set this to conditionally intercept incoming requests to P2SVPNGatewaysServerTransport +var p2SvpnGatewaysServerTransportInterceptor 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/packetcaptures_server.go b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go index ebd0917c7951..9c66112ab9f4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/packetcaptures_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -24,11 +21,11 @@ import ( // PacketCapturesServer is a fake server for instances of the armnetwork.PacketCapturesClient type. type PacketCapturesServer struct { // BeginCreate is the fake for method PacketCapturesClient.BeginCreate - // HTTP status codes to indicate success: http.StatusCreated + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginCreate func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters armnetwork.PacketCapture, options *armnetwork.PacketCapturesClientBeginCreateOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method PacketCapturesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *armnetwork.PacketCapturesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method PacketCapturesClient.Get @@ -44,7 +41,7 @@ type PacketCapturesServer struct { NewListPager func(resourceGroupName string, networkWatcherName string, options *armnetwork.PacketCapturesClientListOptions) (resp azfake.PagerResponder[armnetwork.PacketCapturesClientListResponse]) // BeginStop is the fake for method PacketCapturesClient.BeginStop - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStop func(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, options *armnetwork.PacketCapturesClientBeginStopOptions) (resp azfake.PollerResponder[armnetwork.PacketCapturesClientStopResponse], errResp azfake.ErrorResponder) } @@ -81,31 +78,50 @@ func (p *PacketCapturesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PacketCapturesClient.BeginCreate": - resp, err = p.dispatchBeginCreate(req) - case "PacketCapturesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PacketCapturesClient.Get": - resp, err = p.dispatchGet(req) - case "PacketCapturesClient.BeginGetStatus": - resp, err = p.dispatchBeginGetStatus(req) - case "PacketCapturesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PacketCapturesClient.BeginStop": - resp, err = p.dispatchBeginStop(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PacketCapturesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if packetCapturesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = packetCapturesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PacketCapturesClient.BeginCreate": + res.resp, res.err = p.dispatchBeginCreate(req) + case "PacketCapturesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PacketCapturesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PacketCapturesClient.BeginGetStatus": + res.resp, res.err = p.dispatchBeginGetStatus(req) + case "PacketCapturesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PacketCapturesClient.BeginStop": + res.resp, res.err = p.dispatchBeginStop(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PacketCapturesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -149,9 +165,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginCreate(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusCreated}, resp.StatusCode) { + if !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.StatusCreated", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { p.beginCreate.remove(req) @@ -197,9 +213,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { p.beginDelete.remove(req) @@ -368,9 +384,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginStop(req *http.Request) (*h return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { p.beginStop.remove(req) @@ -378,3 +394,9 @@ func (p *PacketCapturesServerTransport) dispatchBeginStop(req *http.Request) (*h return resp, nil } + +// set this to conditionally intercept incoming requests to PacketCapturesServerTransport +var packetCapturesServerTransportInterceptor 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/peerexpressroutecircuitconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go index 9b2a6e3d1645..48d759ddf105 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/peerexpressroutecircuitconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) Do(req *http.Request return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PeerExpressRouteCircuitConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PeerExpressRouteCircuitConnectionsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if peerExpressRouteCircuitConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = peerExpressRouteCircuitConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PeerExpressRouteCircuitConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PeerExpressRouteCircuitConnectionsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -162,3 +178,9 @@ func (p *PeerExpressRouteCircuitConnectionsServerTransport) dispatchNewListPager } return resp, nil } + +// set this to conditionally intercept incoming requests to PeerExpressRouteCircuitConnectionsServerTransport +var peerExpressRouteCircuitConnectionsServerTransportInterceptor 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/polymorphic_helpers.go b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go index c0f35be01144..d25695c7339f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/network/armnetwork/fake/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" ) 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 834bcaf79745..38540b90b66a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatednszonegroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (p *PrivateDNSZoneGroupsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateDNSZoneGroupsClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PrivateDNSZoneGroupsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateDNSZoneGroupsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateDNSZoneGroupsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateDNSZoneGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateDnsZoneGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateDnsZoneGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateDNSZoneGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PrivateDNSZoneGroupsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateDNSZoneGroupsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateDNSZoneGroupsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateDNSZoneGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (p *PrivateDNSZoneGroupsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateDNSZoneGroupsServerTransport +var privateDnsZoneGroupsServerTransportInterceptor 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/privateendpoints_server.go b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go index 7346ec6d5fc3..df9de0403595 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privateendpoints_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (p *PrivateEndpointsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointsClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PrivateEndpointsClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateEndpointsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointsClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PrivateEndpointsClient.NewListBySubscriptionPager": - resp, err = p.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointsClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PrivateEndpointsClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateEndpointsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointsClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PrivateEndpointsClient.NewListBySubscriptionPager": + res.resp, res.err = p.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -307,3 +323,9 @@ func (p *PrivateEndpointsServerTransport) dispatchNewListBySubscriptionPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointsServerTransport +var privateEndpointsServerTransportInterceptor 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/privatelinkservices_server.go b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go index adf2eaa6b929..6416532db1cf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/privatelinkservices_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -120,45 +117,64 @@ func (p *PrivateLinkServicesServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility": - resp, err = p.dispatchBeginCheckPrivateLinkServiceVisibility(req) - case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup": - resp, err = p.dispatchBeginCheckPrivateLinkServiceVisibilityByResourceGroup(req) - case "PrivateLinkServicesClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PrivateLinkServicesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection": - resp, err = p.dispatchBeginDeletePrivateEndpointConnection(req) - case "PrivateLinkServicesClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateLinkServicesClient.GetPrivateEndpointConnection": - resp, err = p.dispatchGetPrivateEndpointConnection(req) - case "PrivateLinkServicesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager": - resp, err = p.dispatchNewListAutoApprovedPrivateLinkServicesPager(req) - case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager": - resp, err = p.dispatchNewListAutoApprovedPrivateLinkServicesByResourceGroupPager(req) - case "PrivateLinkServicesClient.NewListBySubscriptionPager": - resp, err = p.dispatchNewListBySubscriptionPager(req) - case "PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager": - resp, err = p.dispatchNewListPrivateEndpointConnectionsPager(req) - case "PrivateLinkServicesClient.UpdatePrivateEndpointConnection": - resp, err = p.dispatchUpdatePrivateEndpointConnection(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return p.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (p *PrivateLinkServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if privateLinkServicesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkServicesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility": + res.resp, res.err = p.dispatchBeginCheckPrivateLinkServiceVisibility(req) + case "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup": + res.resp, res.err = p.dispatchBeginCheckPrivateLinkServiceVisibilityByResourceGroup(req) + case "PrivateLinkServicesClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PrivateLinkServicesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection": + res.resp, res.err = p.dispatchBeginDeletePrivateEndpointConnection(req) + case "PrivateLinkServicesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateLinkServicesClient.GetPrivateEndpointConnection": + res.resp, res.err = p.dispatchGetPrivateEndpointConnection(req) + case "PrivateLinkServicesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager": + res.resp, res.err = p.dispatchNewListAutoApprovedPrivateLinkServicesPager(req) + case "PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesByResourceGroupPager": + res.resp, res.err = p.dispatchNewListAutoApprovedPrivateLinkServicesByResourceGroupPager(req) + case "PrivateLinkServicesClient.NewListBySubscriptionPager": + res.resp, res.err = p.dispatchNewListBySubscriptionPager(req) + case "PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager": + res.resp, res.err = p.dispatchNewListPrivateEndpointConnectionsPager(req) + case "PrivateLinkServicesClient.UpdatePrivateEndpointConnection": + res.resp, res.err = p.dispatchUpdatePrivateEndpointConnection(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (p *PrivateLinkServicesServerTransport) dispatchBeginCheckPrivateLinkServiceVisibility(req *http.Request) (*http.Response, error) { @@ -716,3 +732,9 @@ func (p *PrivateLinkServicesServerTransport) dispatchUpdatePrivateEndpointConnec } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkServicesServerTransport +var privateLinkServicesServerTransportInterceptor 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/profiles_server.go b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go index 155ddbf49451..afde66f91be5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/profiles_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -78,31 +75,50 @@ func (p *ProfilesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "ProfilesClient.CreateOrUpdate": - resp, err = p.dispatchCreateOrUpdate(req) - case "ProfilesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "ProfilesClient.Get": - resp, err = p.dispatchGet(req) - case "ProfilesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "ProfilesClient.NewListAllPager": - resp, err = p.dispatchNewListAllPager(req) - case "ProfilesClient.UpdateTags": - resp, err = p.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *ProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if profilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = profilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ProfilesClient.CreateOrUpdate": + res.resp, res.err = p.dispatchCreateOrUpdate(req) + case "ProfilesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "ProfilesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "ProfilesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "ProfilesClient.NewListAllPager": + res.resp, res.err = p.dispatchNewListAllPager(req) + case "ProfilesClient.UpdateTags": + res.resp, res.err = p.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *ProfilesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -337,3 +353,9 @@ func (p *ProfilesServerTransport) dispatchUpdateTags(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to ProfilesServerTransport +var profilesServerTransportInterceptor 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/publicipaddresses_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go index f125b0b66098..3465c76805f6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipaddresses_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -118,45 +115,64 @@ func (p *PublicIPAddressesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "PublicIPAddressesClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PublicIPAddressesClient.BeginDdosProtectionStatus": - resp, err = p.dispatchBeginDdosProtectionStatus(req) - case "PublicIPAddressesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PublicIPAddressesClient.Get": - resp, err = p.dispatchGet(req) - case "PublicIPAddressesClient.GetCloudServicePublicIPAddress": - resp, err = p.dispatchGetCloudServicePublicIPAddress(req) - case "PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress": - resp, err = p.dispatchGetVirtualMachineScaleSetPublicIPAddress(req) - case "PublicIPAddressesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PublicIPAddressesClient.NewListAllPager": - resp, err = p.dispatchNewListAllPager(req) - case "PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager": - resp, err = p.dispatchNewListCloudServicePublicIPAddressesPager(req) - case "PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager": - resp, err = p.dispatchNewListCloudServiceRoleInstancePublicIPAddressesPager(req) - case "PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager": - resp, err = p.dispatchNewListVirtualMachineScaleSetPublicIPAddressesPager(req) - case "PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager": - resp, err = p.dispatchNewListVirtualMachineScaleSetVMPublicIPAddressesPager(req) - case "PublicIPAddressesClient.UpdateTags": - resp, err = p.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return p.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (p *PublicIPAddressesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if publicIPAddressesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = publicIPAddressesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PublicIPAddressesClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PublicIPAddressesClient.BeginDdosProtectionStatus": + res.resp, res.err = p.dispatchBeginDdosProtectionStatus(req) + case "PublicIPAddressesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PublicIPAddressesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PublicIPAddressesClient.GetCloudServicePublicIPAddress": + res.resp, res.err = p.dispatchGetCloudServicePublicIPAddress(req) + case "PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress": + res.resp, res.err = p.dispatchGetVirtualMachineScaleSetPublicIPAddress(req) + case "PublicIPAddressesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PublicIPAddressesClient.NewListAllPager": + res.resp, res.err = p.dispatchNewListAllPager(req) + case "PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager": + res.resp, res.err = p.dispatchNewListCloudServicePublicIPAddressesPager(req) + case "PublicIPAddressesClient.NewListCloudServiceRoleInstancePublicIPAddressesPager": + res.resp, res.err = p.dispatchNewListCloudServiceRoleInstancePublicIPAddressesPager(req) + case "PublicIPAddressesClient.NewListVirtualMachineScaleSetPublicIPAddressesPager": + res.resp, res.err = p.dispatchNewListVirtualMachineScaleSetPublicIPAddressesPager(req) + case "PublicIPAddressesClient.NewListVirtualMachineScaleSetVMPublicIPAddressesPager": + res.resp, res.err = p.dispatchNewListVirtualMachineScaleSetVMPublicIPAddressesPager(req) + case "PublicIPAddressesClient.UpdateTags": + res.resp, res.err = p.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (p *PublicIPAddressesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -756,3 +772,9 @@ func (p *PublicIPAddressesServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to PublicIPAddressesServerTransport +var publicIPAddressesServerTransportInterceptor 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/publicipprefixes_server.go b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go index 855a90c6a970..9187a814f07c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/publicipprefixes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (p *PublicIPPrefixesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PublicIPPrefixesClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PublicIPPrefixesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "PublicIPPrefixesClient.Get": - resp, err = p.dispatchGet(req) - case "PublicIPPrefixesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PublicIPPrefixesClient.NewListAllPager": - resp, err = p.dispatchNewListAllPager(req) - case "PublicIPPrefixesClient.UpdateTags": - resp, err = p.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PublicIPPrefixesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if publicIPPrefixesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = publicIPPrefixesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PublicIPPrefixesClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PublicIPPrefixesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "PublicIPPrefixesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PublicIPPrefixesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PublicIPPrefixesClient.NewListAllPager": + res.resp, res.err = p.dispatchNewListAllPager(req) + case "PublicIPPrefixesClient.UpdateTags": + res.resp, res.err = p.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PublicIPPrefixesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (p *PublicIPPrefixesServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to PublicIPPrefixesServerTransport +var publicIPPrefixesServerTransportInterceptor 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/reachabilityanalysisintents_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go index 5b2de118b013..7995f2fd3c5f 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisintents_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (r *ReachabilityAnalysisIntentsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ReachabilityAnalysisIntentsClient.Create": - resp, err = r.dispatchCreate(req) - case "ReachabilityAnalysisIntentsClient.Delete": - resp, err = r.dispatchDelete(req) - case "ReachabilityAnalysisIntentsClient.Get": - resp, err = r.dispatchGet(req) - case "ReachabilityAnalysisIntentsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ReachabilityAnalysisIntentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if reachabilityAnalysisIntentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = reachabilityAnalysisIntentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ReachabilityAnalysisIntentsClient.Create": + res.resp, res.err = r.dispatchCreate(req) + case "ReachabilityAnalysisIntentsClient.Delete": + res.resp, res.err = r.dispatchDelete(req) + case "ReachabilityAnalysisIntentsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "ReachabilityAnalysisIntentsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ReachabilityAnalysisIntentsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -315,3 +331,9 @@ func (r *ReachabilityAnalysisIntentsServerTransport) dispatchNewListPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to ReachabilityAnalysisIntentsServerTransport +var reachabilityAnalysisIntentsServerTransportInterceptor 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/reachabilityanalysisruns_server.go b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go index b3bfbac76693..c69aa7c75806 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/reachabilityanalysisruns_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -30,7 +27,7 @@ type ReachabilityAnalysisRunsServer struct { Create func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, body armnetwork.ReachabilityAnalysisRun, options *armnetwork.ReachabilityAnalysisRunsClientCreateOptions) (resp azfake.Responder[armnetwork.ReachabilityAnalysisRunsClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ReachabilityAnalysisRunsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, options *armnetwork.ReachabilityAnalysisRunsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.ReachabilityAnalysisRunsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method ReachabilityAnalysisRunsClient.Get @@ -69,27 +66,46 @@ func (r *ReachabilityAnalysisRunsServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ReachabilityAnalysisRunsClient.Create": - resp, err = r.dispatchCreate(req) - case "ReachabilityAnalysisRunsClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "ReachabilityAnalysisRunsClient.Get": - resp, err = r.dispatchGet(req) - case "ReachabilityAnalysisRunsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ReachabilityAnalysisRunsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if reachabilityAnalysisRunsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = reachabilityAnalysisRunsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ReachabilityAnalysisRunsClient.Create": + res.resp, res.err = r.dispatchCreate(req) + case "ReachabilityAnalysisRunsClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "ReachabilityAnalysisRunsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "ReachabilityAnalysisRunsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ReachabilityAnalysisRunsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -178,9 +194,9 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchBeginDelete(req *http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { r.beginDelete.remove(req) @@ -328,3 +344,9 @@ func (r *ReachabilityAnalysisRunsServerTransport) dispatchNewListPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to ReachabilityAnalysisRunsServerTransport +var reachabilityAnalysisRunsServerTransportInterceptor 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/resourcenavigationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go index c731ef5187d3..9cd9a60e1b0a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/resourcenavigationlinks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (r *ResourceNavigationLinksServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ResourceNavigationLinksClient.List": - resp, err = r.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ResourceNavigationLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if resourceNavigationLinksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = resourceNavigationLinksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ResourceNavigationLinksClient.List": + res.resp, res.err = r.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ResourceNavigationLinksServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (r *ResourceNavigationLinksServerTransport) dispatchList(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ResourceNavigationLinksServerTransport +var resourceNavigationLinksServerTransportInterceptor 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/routefilterrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go index 03b82a4ff0ba..ad7a57c17f78 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilterrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (r *RouteFilterRulesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RouteFilterRulesClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RouteFilterRulesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RouteFilterRulesClient.Get": - resp, err = r.dispatchGet(req) - case "RouteFilterRulesClient.NewListByRouteFilterPager": - resp, err = r.dispatchNewListByRouteFilterPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RouteFilterRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routeFilterRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routeFilterRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RouteFilterRulesClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RouteFilterRulesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RouteFilterRulesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RouteFilterRulesClient.NewListByRouteFilterPager": + res.resp, res.err = r.dispatchNewListByRouteFilterPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RouteFilterRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (r *RouteFilterRulesServerTransport) dispatchNewListByRouteFilterPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to RouteFilterRulesServerTransport +var routeFilterRulesServerTransportInterceptor 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/routefilters_server.go b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go index d0e6f94d91c1..fae7fff16a3b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routefilters_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (r *RouteFiltersServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RouteFiltersClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RouteFiltersClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RouteFiltersClient.Get": - resp, err = r.dispatchGet(req) - case "RouteFiltersClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - case "RouteFiltersClient.NewListByResourceGroupPager": - resp, err = r.dispatchNewListByResourceGroupPager(req) - case "RouteFiltersClient.UpdateTags": - resp, err = r.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RouteFiltersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routeFiltersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routeFiltersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RouteFiltersClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RouteFiltersClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RouteFiltersClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RouteFiltersClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + case "RouteFiltersClient.NewListByResourceGroupPager": + res.resp, res.err = r.dispatchNewListByResourceGroupPager(req) + case "RouteFiltersClient.UpdateTags": + res.resp, res.err = r.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RouteFiltersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (r *RouteFiltersServerTransport) dispatchUpdateTags(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to RouteFiltersServerTransport +var routeFiltersServerTransportInterceptor 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/routemaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go index d45bab46b98b..6c2eb178775c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routemaps_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (r *RouteMapsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RouteMapsClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RouteMapsClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RouteMapsClient.Get": - resp, err = r.dispatchGet(req) - case "RouteMapsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RouteMapsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routeMapsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routeMapsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RouteMapsClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RouteMapsClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RouteMapsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RouteMapsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RouteMapsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (r *RouteMapsServerTransport) dispatchNewListPager(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to RouteMapsServerTransport +var routeMapsServerTransportInterceptor 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/routes_server.go b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go index cda31ce573cb..4649468f8db8 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routes_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (r *RoutesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RoutesClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RoutesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RoutesClient.Get": - resp, err = r.dispatchGet(req) - case "RoutesClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RoutesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RoutesClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RoutesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RoutesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RoutesClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RoutesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (r *RoutesServerTransport) dispatchNewListPager(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to RoutesServerTransport +var routesServerTransportInterceptor 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/routetables_server.go b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go index 38bfc6d01adf..6ced28790455 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routetables_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (r *RouteTablesServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RouteTablesClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RouteTablesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RouteTablesClient.Get": - resp, err = r.dispatchGet(req) - case "RouteTablesClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - case "RouteTablesClient.NewListAllPager": - resp, err = r.dispatchNewListAllPager(req) - case "RouteTablesClient.UpdateTags": - resp, err = r.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RouteTablesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routeTablesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routeTablesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RouteTablesClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RouteTablesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RouteTablesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RouteTablesClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + case "RouteTablesClient.NewListAllPager": + res.resp, res.err = r.dispatchNewListAllPager(req) + case "RouteTablesClient.UpdateTags": + res.resp, res.err = r.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RouteTablesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (r *RouteTablesServerTransport) dispatchUpdateTags(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to RouteTablesServerTransport +var routeTablesServerTransportInterceptor 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/routingintent_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go index a64d6681a210..276acfbb6ebf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingintent_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (r *RoutingIntentServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RoutingIntentClient.BeginCreateOrUpdate": - resp, err = r.dispatchBeginCreateOrUpdate(req) - case "RoutingIntentClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RoutingIntentClient.Get": - resp, err = r.dispatchGet(req) - case "RoutingIntentClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RoutingIntentServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routingIntentServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routingIntentServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RoutingIntentClient.BeginCreateOrUpdate": + res.resp, res.err = r.dispatchBeginCreateOrUpdate(req) + case "RoutingIntentClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RoutingIntentClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RoutingIntentClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RoutingIntentServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (r *RoutingIntentServerTransport) dispatchNewListPager(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to RoutingIntentServerTransport +var routingIntentServerTransportInterceptor 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/routingrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go index 5222db6cad3a..3da83597af6a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrulecollections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (r *RoutingRuleCollectionsServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RoutingRuleCollectionsClient.CreateOrUpdate": - resp, err = r.dispatchCreateOrUpdate(req) - case "RoutingRuleCollectionsClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RoutingRuleCollectionsClient.Get": - resp, err = r.dispatchGet(req) - case "RoutingRuleCollectionsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RoutingRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routingRuleCollectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routingRuleCollectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RoutingRuleCollectionsClient.CreateOrUpdate": + res.resp, res.err = r.dispatchCreateOrUpdate(req) + case "RoutingRuleCollectionsClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RoutingRuleCollectionsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RoutingRuleCollectionsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RoutingRuleCollectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -316,3 +332,9 @@ func (r *RoutingRuleCollectionsServerTransport) dispatchNewListPager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to RoutingRuleCollectionsServerTransport +var routingRuleCollectionsServerTransportInterceptor 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/routingrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go index 9a46348662f4..fb3b577c49df 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/routingrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (r *RoutingRulesServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RoutingRulesClient.CreateOrUpdate": - resp, err = r.dispatchCreateOrUpdate(req) - case "RoutingRulesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RoutingRulesClient.Get": - resp, err = r.dispatchGet(req) - case "RoutingRulesClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RoutingRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routingRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routingRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RoutingRulesClient.CreateOrUpdate": + res.resp, res.err = r.dispatchCreateOrUpdate(req) + case "RoutingRulesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RoutingRulesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RoutingRulesClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RoutingRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -332,3 +348,9 @@ func (r *RoutingRulesServerTransport) dispatchNewListPager(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to RoutingRulesServerTransport +var routingRulesServerTransportInterceptor 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/scopeconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go index 152199dd715f..af9718e321cd 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/scopeconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (s *ScopeConnectionsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ScopeConnectionsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "ScopeConnectionsClient.Delete": - resp, err = s.dispatchDelete(req) - case "ScopeConnectionsClient.Get": - resp, err = s.dispatchGet(req) - case "ScopeConnectionsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ScopeConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if scopeConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = scopeConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ScopeConnectionsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "ScopeConnectionsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ScopeConnectionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ScopeConnectionsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ScopeConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -272,3 +288,9 @@ func (s *ScopeConnectionsServerTransport) dispatchNewListPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ScopeConnectionsServerTransport +var scopeConnectionsServerTransportInterceptor 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/securityadminconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go index a1b88a59778b..75c43ade1dc4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityadminconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (s *SecurityAdminConfigurationsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityAdminConfigurationsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SecurityAdminConfigurationsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityAdminConfigurationsClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityAdminConfigurationsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityAdminConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityAdminConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityAdminConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityAdminConfigurationsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityAdminConfigurationsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityAdminConfigurationsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityAdminConfigurationsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityAdminConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -300,3 +316,9 @@ func (s *SecurityAdminConfigurationsServerTransport) dispatchNewListPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityAdminConfigurationsServerTransport +var securityAdminConfigurationsServerTransportInterceptor 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/securitygroups_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go index aa05338961d9..fa5167193bc9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitygroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (s *SecurityGroupsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityGroupsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "SecurityGroupsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityGroupsClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityGroupsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SecurityGroupsClient.NewListAllPager": - resp, err = s.dispatchNewListAllPager(req) - case "SecurityGroupsClient.UpdateTags": - resp, err = s.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityGroupsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SecurityGroupsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityGroupsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityGroupsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecurityGroupsClient.NewListAllPager": + res.resp, res.err = s.dispatchNewListAllPager(req) + case "SecurityGroupsClient.UpdateTags": + res.resp, res.err = s.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityGroupsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (s *SecurityGroupsServerTransport) dispatchUpdateTags(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityGroupsServerTransport +var securityGroupsServerTransportInterceptor 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/securitypartnerproviders_server.go b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go index 853e8e4d6032..6ae8e16f5f72 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securitypartnerproviders_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (s *SecurityPartnerProvidersServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityPartnerProvidersClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "SecurityPartnerProvidersClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityPartnerProvidersClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityPartnerProvidersClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SecurityPartnerProvidersClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "SecurityPartnerProvidersClient.UpdateTags": - resp, err = s.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityPartnerProvidersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityPartnerProvidersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPartnerProvidersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPartnerProvidersClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SecurityPartnerProvidersClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPartnerProvidersClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPartnerProvidersClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecurityPartnerProvidersClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "SecurityPartnerProvidersClient.UpdateTags": + res.resp, res.err = s.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityPartnerProvidersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (s *SecurityPartnerProvidersServerTransport) dispatchUpdateTags(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityPartnerProvidersServerTransport +var securityPartnerProvidersServerTransportInterceptor 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/securityperimeteraccessrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go new file mode 100644 index 000000000000..570ed1c7d226 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteraccessrules_server.go @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimeterAccessRulesServer is a fake server for instances of the armnetwork.SecurityPerimeterAccessRulesClient type. +type SecurityPerimeterAccessRulesServer struct { + // CreateOrUpdate is the fake for method SecurityPerimeterAccessRulesClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters armnetwork.NspAccessRule, options *armnetwork.SecurityPerimeterAccessRulesClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterAccessRulesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method SecurityPerimeterAccessRulesClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, options *armnetwork.SecurityPerimeterAccessRulesClientDeleteOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterAccessRulesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterAccessRulesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, options *armnetwork.SecurityPerimeterAccessRulesClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterAccessRulesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterAccessRulesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *armnetwork.SecurityPerimeterAccessRulesClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterAccessRulesClientListResponse]) + + // Reconcile is the fake for method SecurityPerimeterAccessRulesClient.Reconcile + // HTTP status codes to indicate success: http.StatusOK + Reconcile func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters any, options *armnetwork.SecurityPerimeterAccessRulesClientReconcileOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterAccessRulesClientReconcileResponse], errResp azfake.ErrorResponder) +} + +// NewSecurityPerimeterAccessRulesServerTransport creates a new instance of SecurityPerimeterAccessRulesServerTransport with the provided implementation. +// The returned SecurityPerimeterAccessRulesServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterAccessRulesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterAccessRulesServerTransport(srv *SecurityPerimeterAccessRulesServer) *SecurityPerimeterAccessRulesServerTransport { + return &SecurityPerimeterAccessRulesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAccessRulesClientListResponse]](), + } +} + +// SecurityPerimeterAccessRulesServerTransport connects instances of armnetwork.SecurityPerimeterAccessRulesClient to instances of SecurityPerimeterAccessRulesServer. +// Don't use this type directly, use NewSecurityPerimeterAccessRulesServerTransport instead. +type SecurityPerimeterAccessRulesServerTransport struct { + srv *SecurityPerimeterAccessRulesServer + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAccessRulesClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterAccessRulesServerTransport. +func (s *SecurityPerimeterAccessRulesServerTransport) 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 *SecurityPerimeterAccessRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterAccessRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterAccessRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterAccessRulesClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityPerimeterAccessRulesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SecurityPerimeterAccessRulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterAccessRulesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecurityPerimeterAccessRulesClient.Reconcile": + res.resp, res.err = s.dispatchReconcile(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterAccessRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.NspAccessRule](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + accessRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessRuleName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, accessRuleNameParam, 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) { + 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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterAccessRulesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + accessRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessRuleName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Delete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, accessRuleNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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 (s *SecurityPerimeterAccessRulesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + accessRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessRuleName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, accessRuleNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterAccessRulesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessRules` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimeterAccessRulesClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimeterAccessRulesClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterAccessRulesClientListResponse, 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) { + 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 +} + +func (s *SecurityPerimeterAccessRulesServerTransport) dispatchReconcile(req *http.Request) (*http.Response, error) { + if s.srv.Reconcile == nil { + return nil, &nonRetriableError{errors.New("fake for method Reconcile not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accessRules/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[any](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + accessRuleNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accessRuleName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Reconcile(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, accessRuleNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to SecurityPerimeterAccessRulesServerTransport +var securityPerimeterAccessRulesServerTransportInterceptor 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/securityperimeterassociableresourcetypes_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go new file mode 100644 index 000000000000..0ab5f2933e9f --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociableresourcetypes_server.go @@ -0,0 +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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "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/v7" + "net/http" + "net/url" + "regexp" +) + +// SecurityPerimeterAssociableResourceTypesServer is a fake server for instances of the armnetwork.SecurityPerimeterAssociableResourceTypesClient type. +type SecurityPerimeterAssociableResourceTypesServer struct { + // NewListPager is the fake for method SecurityPerimeterAssociableResourceTypesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(location string, options *armnetwork.SecurityPerimeterAssociableResourceTypesClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterAssociableResourceTypesClientListResponse]) +} + +// NewSecurityPerimeterAssociableResourceTypesServerTransport creates a new instance of SecurityPerimeterAssociableResourceTypesServerTransport with the provided implementation. +// The returned SecurityPerimeterAssociableResourceTypesServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterAssociableResourceTypesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterAssociableResourceTypesServerTransport(srv *SecurityPerimeterAssociableResourceTypesServer) *SecurityPerimeterAssociableResourceTypesServerTransport { + return &SecurityPerimeterAssociableResourceTypesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAssociableResourceTypesClientListResponse]](), + } +} + +// SecurityPerimeterAssociableResourceTypesServerTransport connects instances of armnetwork.SecurityPerimeterAssociableResourceTypesClient to instances of SecurityPerimeterAssociableResourceTypesServer. +// Don't use this type directly, use NewSecurityPerimeterAssociableResourceTypesServerTransport instead. +type SecurityPerimeterAssociableResourceTypesServerTransport struct { + srv *SecurityPerimeterAssociableResourceTypesServer + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAssociableResourceTypesClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterAssociableResourceTypesServerTransport. +func (s *SecurityPerimeterAssociableResourceTypesServerTransport) 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 *SecurityPerimeterAssociableResourceTypesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterAssociableResourceTypesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterAssociableResourceTypesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterAssociableResourceTypesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterAssociableResourceTypesServerTransport) 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~%@]+)/providers/Microsoft\.Network/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/perimeterAssociableResourceTypes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListPager(locationParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterAssociableResourceTypesClientListResponse, 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) { + 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 SecurityPerimeterAssociableResourceTypesServerTransport +var securityPerimeterAssociableResourceTypesServerTransportInterceptor 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/securityperimeterassociations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go new file mode 100644 index 000000000000..ab0944dec50b --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterassociations_server.go @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimeterAssociationsServer is a fake server for instances of the armnetwork.SecurityPerimeterAssociationsClient type. +type SecurityPerimeterAssociationsServer struct { + // BeginCreateOrUpdate is the fake for method SecurityPerimeterAssociationsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters armnetwork.NspAssociation, options *armnetwork.SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SecurityPerimeterAssociationsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, options *armnetwork.SecurityPerimeterAssociationsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterAssociationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, options *armnetwork.SecurityPerimeterAssociationsClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterAssociationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterAssociationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimeterAssociationsClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterAssociationsClientListResponse]) +} + +// NewSecurityPerimeterAssociationsServerTransport creates a new instance of SecurityPerimeterAssociationsServerTransport with the provided implementation. +// The returned SecurityPerimeterAssociationsServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterAssociationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterAssociationsServerTransport(srv *SecurityPerimeterAssociationsServer) *SecurityPerimeterAssociationsServerTransport { + return &SecurityPerimeterAssociationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAssociationsClientListResponse]](), + } +} + +// SecurityPerimeterAssociationsServerTransport connects instances of armnetwork.SecurityPerimeterAssociationsClient to instances of SecurityPerimeterAssociationsServer. +// Don't use this type directly, use NewSecurityPerimeterAssociationsServerTransport instead. +type SecurityPerimeterAssociationsServerTransport struct { + srv *SecurityPerimeterAssociationsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armnetwork.SecurityPerimeterAssociationsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterAssociationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterAssociationsServerTransport. +func (s *SecurityPerimeterAssociationsServerTransport) 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 *SecurityPerimeterAssociationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterAssociationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterAssociationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterAssociationsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SecurityPerimeterAssociationsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPerimeterAssociationsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterAssociationsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterAssociationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceAssociations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.NspAssociation](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, associationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (s *SecurityPerimeterAssociationsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceAssociations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, associationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SecurityPerimeterAssociationsServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceAssociations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + associationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("associationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, associationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterAssociationsServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceAssociations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimeterAssociationsClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimeterAssociationsClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterAssociationsClientListResponse, 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) { + 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 SecurityPerimeterAssociationsServerTransport +var securityPerimeterAssociationsServerTransportInterceptor 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/securityperimeterlinkreferences_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go new file mode 100644 index 000000000000..c6170d27c93c --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinkreferences_server.go @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimeterLinkReferencesServer is a fake server for instances of the armnetwork.SecurityPerimeterLinkReferencesClient type. +type SecurityPerimeterLinkReferencesServer struct { + // BeginDelete is the fake for method SecurityPerimeterLinkReferencesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, options *armnetwork.SecurityPerimeterLinkReferencesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.SecurityPerimeterLinkReferencesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterLinkReferencesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, options *armnetwork.SecurityPerimeterLinkReferencesClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLinkReferencesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterLinkReferencesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimeterLinkReferencesClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterLinkReferencesClientListResponse]) +} + +// NewSecurityPerimeterLinkReferencesServerTransport creates a new instance of SecurityPerimeterLinkReferencesServerTransport with the provided implementation. +// The returned SecurityPerimeterLinkReferencesServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterLinkReferencesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterLinkReferencesServerTransport(srv *SecurityPerimeterLinkReferencesServer) *SecurityPerimeterLinkReferencesServerTransport { + return &SecurityPerimeterLinkReferencesServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armnetwork.SecurityPerimeterLinkReferencesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLinkReferencesClientListResponse]](), + } +} + +// SecurityPerimeterLinkReferencesServerTransport connects instances of armnetwork.SecurityPerimeterLinkReferencesClient to instances of SecurityPerimeterLinkReferencesServer. +// Don't use this type directly, use NewSecurityPerimeterLinkReferencesServerTransport instead. +type SecurityPerimeterLinkReferencesServerTransport struct { + srv *SecurityPerimeterLinkReferencesServer + beginDelete *tracker[azfake.PollerResponder[armnetwork.SecurityPerimeterLinkReferencesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLinkReferencesClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterLinkReferencesServerTransport. +func (s *SecurityPerimeterLinkReferencesServerTransport) 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 *SecurityPerimeterLinkReferencesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterLinkReferencesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterLinkReferencesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterLinkReferencesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPerimeterLinkReferencesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterLinkReferencesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterLinkReferencesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/linkReferences/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + linkReferenceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkReferenceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, linkReferenceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SecurityPerimeterLinkReferencesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/linkReferences/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + linkReferenceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkReferenceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, linkReferenceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterLinkReferencesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/linkReferences` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimeterLinkReferencesClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimeterLinkReferencesClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterLinkReferencesClientListResponse, 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) { + 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 SecurityPerimeterLinkReferencesServerTransport +var securityPerimeterLinkReferencesServerTransportInterceptor 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/securityperimeterlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_server.go new file mode 100644 index 000000000000..acfab1442492 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterlinks_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) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimeterLinksServer is a fake server for instances of the armnetwork.SecurityPerimeterLinksClient type. +type SecurityPerimeterLinksServer struct { + // CreateOrUpdate is the fake for method SecurityPerimeterLinksClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, parameters armnetwork.NspLink, options *armnetwork.SecurityPerimeterLinksClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLinksClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SecurityPerimeterLinksClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, options *armnetwork.SecurityPerimeterLinksClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.SecurityPerimeterLinksClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterLinksClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, options *armnetwork.SecurityPerimeterLinksClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLinksClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterLinksClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimeterLinksClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterLinksClientListResponse]) +} + +// NewSecurityPerimeterLinksServerTransport creates a new instance of SecurityPerimeterLinksServerTransport with the provided implementation. +// The returned SecurityPerimeterLinksServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterLinksClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterLinksServerTransport(srv *SecurityPerimeterLinksServer) *SecurityPerimeterLinksServerTransport { + return &SecurityPerimeterLinksServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armnetwork.SecurityPerimeterLinksClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLinksClientListResponse]](), + } +} + +// SecurityPerimeterLinksServerTransport connects instances of armnetwork.SecurityPerimeterLinksClient to instances of SecurityPerimeterLinksServer. +// Don't use this type directly, use NewSecurityPerimeterLinksServerTransport instead. +type SecurityPerimeterLinksServerTransport struct { + srv *SecurityPerimeterLinksServer + beginDelete *tracker[azfake.PollerResponder[armnetwork.SecurityPerimeterLinksClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLinksClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterLinksServerTransport. +func (s *SecurityPerimeterLinksServerTransport) 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 *SecurityPerimeterLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterLinksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterLinksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterLinksClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityPerimeterLinksClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPerimeterLinksClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterLinksClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterLinksServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/links/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.NspLink](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + linkNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, linkNameParam, 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) { + 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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterLinksServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/links/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + linkNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, linkNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SecurityPerimeterLinksServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/links/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + linkNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("linkName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, linkNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterLinksServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/links` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimeterLinksClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimeterLinksClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterLinksClientListResponse, 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) { + 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 SecurityPerimeterLinksServerTransport +var securityPerimeterLinksServerTransportInterceptor 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/securityperimeterloggingconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go new file mode 100644 index 000000000000..b253d08dae6e --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterloggingconfigurations_server.go @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" +) + +// SecurityPerimeterLoggingConfigurationsServer is a fake server for instances of the armnetwork.SecurityPerimeterLoggingConfigurationsClient type. +type SecurityPerimeterLoggingConfigurationsServer struct { + // CreateOrUpdate is the fake for method SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, parameters armnetwork.NspLoggingConfiguration, options *armnetwork.SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method SecurityPerimeterLoggingConfigurationsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, options *armnetwork.SecurityPerimeterLoggingConfigurationsClientDeleteOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLoggingConfigurationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterLoggingConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, options *armnetwork.SecurityPerimeterLoggingConfigurationsClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterLoggingConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterLoggingConfigurationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimeterLoggingConfigurationsClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterLoggingConfigurationsClientListResponse]) +} + +// NewSecurityPerimeterLoggingConfigurationsServerTransport creates a new instance of SecurityPerimeterLoggingConfigurationsServerTransport with the provided implementation. +// The returned SecurityPerimeterLoggingConfigurationsServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterLoggingConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterLoggingConfigurationsServerTransport(srv *SecurityPerimeterLoggingConfigurationsServer) *SecurityPerimeterLoggingConfigurationsServerTransport { + return &SecurityPerimeterLoggingConfigurationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLoggingConfigurationsClientListResponse]](), + } +} + +// SecurityPerimeterLoggingConfigurationsServerTransport connects instances of armnetwork.SecurityPerimeterLoggingConfigurationsClient to instances of SecurityPerimeterLoggingConfigurationsServer. +// Don't use this type directly, use NewSecurityPerimeterLoggingConfigurationsServerTransport instead. +type SecurityPerimeterLoggingConfigurationsServerTransport struct { + srv *SecurityPerimeterLoggingConfigurationsServer + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterLoggingConfigurationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterLoggingConfigurationsServerTransport. +func (s *SecurityPerimeterLoggingConfigurationsServerTransport) 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 *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterLoggingConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterLoggingConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityPerimeterLoggingConfigurationsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SecurityPerimeterLoggingConfigurationsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterLoggingConfigurationsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loggingConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.NspLoggingConfiguration](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + loggingConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loggingConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, loggingConfigurationNameParam, 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) { + 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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterLoggingConfigurationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loggingConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + loggingConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loggingConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Delete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, loggingConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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 (s *SecurityPerimeterLoggingConfigurationsServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loggingConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + loggingConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loggingConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, loggingConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterLoggingConfigurationsServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loggingConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterLoggingConfigurationsClientListResponse, 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) { + 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 SecurityPerimeterLoggingConfigurationsServerTransport +var securityPerimeterLoggingConfigurationsServerTransportInterceptor 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/securityperimeteroperationstatuses_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go new file mode 100644 index 000000000000..1726377ae632 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeteroperationstatuses_server.go @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/resourcemanager/network/armnetwork/v7" + "net/http" + "net/url" + "regexp" +) + +// SecurityPerimeterOperationStatusesServer is a fake server for instances of the armnetwork.SecurityPerimeterOperationStatusesClient type. +type SecurityPerimeterOperationStatusesServer struct { + // Get is the fake for method SecurityPerimeterOperationStatusesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, location string, operationID string, options *armnetwork.SecurityPerimeterOperationStatusesClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterOperationStatusesClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewSecurityPerimeterOperationStatusesServerTransport creates a new instance of SecurityPerimeterOperationStatusesServerTransport with the provided implementation. +// The returned SecurityPerimeterOperationStatusesServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterOperationStatusesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterOperationStatusesServerTransport(srv *SecurityPerimeterOperationStatusesServer) *SecurityPerimeterOperationStatusesServerTransport { + return &SecurityPerimeterOperationStatusesServerTransport{srv: srv} +} + +// SecurityPerimeterOperationStatusesServerTransport connects instances of armnetwork.SecurityPerimeterOperationStatusesClient to instances of SecurityPerimeterOperationStatusesServer. +// Don't use this type directly, use NewSecurityPerimeterOperationStatusesServerTransport instead. +type SecurityPerimeterOperationStatusesServerTransport struct { + srv *SecurityPerimeterOperationStatusesServer +} + +// Do implements the policy.Transporter interface for SecurityPerimeterOperationStatusesServerTransport. +func (s *SecurityPerimeterOperationStatusesServerTransport) 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 *SecurityPerimeterOperationStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterOperationStatusesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterOperationStatusesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterOperationStatusesClient.Get": + res.resp, res.err = s.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterOperationStatusesServerTransport) 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~%@]+)/providers/Microsoft\.Network/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterOperationStatuses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), locationParam, operationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to SecurityPerimeterOperationStatusesServerTransport +var securityPerimeterOperationStatusesServerTransportInterceptor 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/securityperimeterprofiles_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go new file mode 100644 index 000000000000..862d2f490de4 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeterprofiles_server.go @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimeterProfilesServer is a fake server for instances of the armnetwork.SecurityPerimeterProfilesClient type. +type SecurityPerimeterProfilesServer struct { + // CreateOrUpdate is the fake for method SecurityPerimeterProfilesClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, parameters armnetwork.NspProfile, options *armnetwork.SecurityPerimeterProfilesClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterProfilesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method SecurityPerimeterProfilesClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *armnetwork.SecurityPerimeterProfilesClientDeleteOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterProfilesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimeterProfilesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *armnetwork.SecurityPerimeterProfilesClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimeterProfilesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimeterProfilesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimeterProfilesClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimeterProfilesClientListResponse]) +} + +// NewSecurityPerimeterProfilesServerTransport creates a new instance of SecurityPerimeterProfilesServerTransport with the provided implementation. +// The returned SecurityPerimeterProfilesServerTransport instance is connected to an instance of armnetwork.SecurityPerimeterProfilesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimeterProfilesServerTransport(srv *SecurityPerimeterProfilesServer) *SecurityPerimeterProfilesServerTransport { + return &SecurityPerimeterProfilesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimeterProfilesClientListResponse]](), + } +} + +// SecurityPerimeterProfilesServerTransport connects instances of armnetwork.SecurityPerimeterProfilesClient to instances of SecurityPerimeterProfilesServer. +// Don't use this type directly, use NewSecurityPerimeterProfilesServerTransport instead. +type SecurityPerimeterProfilesServerTransport struct { + srv *SecurityPerimeterProfilesServer + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimeterProfilesClientListResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimeterProfilesServerTransport. +func (s *SecurityPerimeterProfilesServerTransport) 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 *SecurityPerimeterProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimeterProfilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimeterProfilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimeterProfilesClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityPerimeterProfilesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SecurityPerimeterProfilesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimeterProfilesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimeterProfilesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.NspProfile](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, 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) { + 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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterProfilesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Delete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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 (s *SecurityPerimeterProfilesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, profileNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimeterProfilesServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/profiles` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimeterProfilesClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimeterProfilesClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, networkSecurityPerimeterNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimeterProfilesClientListResponse, 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) { + 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 SecurityPerimeterProfilesServerTransport +var securityPerimeterProfilesServerTransportInterceptor 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/securityperimeters_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go new file mode 100644 index 000000000000..c8e6b1537e7e --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/fake/securityperimeters_server.go @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 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/v7" + "net/http" + "net/url" + "regexp" + "strconv" +) + +// SecurityPerimetersServer is a fake server for instances of the armnetwork.SecurityPerimetersClient type. +type SecurityPerimetersServer struct { + // CreateOrUpdate is the fake for method SecurityPerimetersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters armnetwork.SecurityPerimeter, options *armnetwork.SecurityPerimetersClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.SecurityPerimetersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method SecurityPerimetersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimetersClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.SecurityPerimetersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method SecurityPerimetersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *armnetwork.SecurityPerimetersClientGetOptions) (resp azfake.Responder[armnetwork.SecurityPerimetersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method SecurityPerimetersClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armnetwork.SecurityPerimetersClientListOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimetersClientListResponse]) + + // NewListBySubscriptionPager is the fake for method SecurityPerimetersClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armnetwork.SecurityPerimetersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armnetwork.SecurityPerimetersClientListBySubscriptionResponse]) + + // Patch is the fake for method SecurityPerimetersClient.Patch + // HTTP status codes to indicate success: http.StatusOK + Patch func(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters armnetwork.UpdateTagsRequest, options *armnetwork.SecurityPerimetersClientPatchOptions) (resp azfake.Responder[armnetwork.SecurityPerimetersClientPatchResponse], errResp azfake.ErrorResponder) +} + +// NewSecurityPerimetersServerTransport creates a new instance of SecurityPerimetersServerTransport with the provided implementation. +// The returned SecurityPerimetersServerTransport instance is connected to an instance of armnetwork.SecurityPerimetersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewSecurityPerimetersServerTransport(srv *SecurityPerimetersServer) *SecurityPerimetersServerTransport { + return &SecurityPerimetersServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armnetwork.SecurityPerimetersClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimetersClientListResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armnetwork.SecurityPerimetersClientListBySubscriptionResponse]](), + } +} + +// SecurityPerimetersServerTransport connects instances of armnetwork.SecurityPerimetersClient to instances of SecurityPerimetersServer. +// Don't use this type directly, use NewSecurityPerimetersServerTransport instead. +type SecurityPerimetersServerTransport struct { + srv *SecurityPerimetersServer + beginDelete *tracker[azfake.PollerResponder[armnetwork.SecurityPerimetersClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimetersClientListResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armnetwork.SecurityPerimetersClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for SecurityPerimetersServerTransport. +func (s *SecurityPerimetersServerTransport) 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 *SecurityPerimetersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if securityPerimetersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPerimetersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPerimetersClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityPerimetersClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPerimetersClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPerimetersClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecurityPerimetersClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + case "SecurityPerimetersClient.Patch": + res.resp, res.err = s.dispatchPatch(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *SecurityPerimetersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.SecurityPerimeter](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, 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) { + 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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimetersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if s.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDelete(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + s.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) + } + + return resp, nil +} + +func (s *SecurityPerimetersServerTransport) 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/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *SecurityPerimetersServerTransport) 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/networkSecurityPerimeters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + 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 + } + topUnescaped, err := url.QueryUnescape(qp.Get("$top")) + if err != nil { + return nil, err + } + topParam, err := parseOptional(topUnescaped, 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 + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimetersClientListOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimetersClientListOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListPager(resourceGroupNameParam, options) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetwork.SecurityPerimetersClientListResponse, 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) { + 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 +} + +func (s *SecurityPerimetersServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + 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) { + p, parseErr := strconv.ParseInt(v, 10, 32) + if parseErr != nil { + return 0, parseErr + } + return int32(p), nil + }) + if err != nil { + return nil, err + } + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armnetwork.SecurityPerimetersClientListBySubscriptionOptions + if topParam != nil || skipTokenParam != nil { + options = &armnetwork.SecurityPerimetersClientListBySubscriptionOptions{ + Top: topParam, + SkipToken: skipTokenParam, + } + } + resp := s.srv.NewListBySubscriptionPager(options) + newListBySubscriptionPager = &resp + s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armnetwork.SecurityPerimetersClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !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)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + s.newListBySubscriptionPager.remove(req) + } + return resp, nil +} + +func (s *SecurityPerimetersServerTransport) dispatchPatch(req *http.Request) (*http.Response, error) { + if s.srv.Patch == nil { + return nil, &nonRetriableError{errors.New("fake for method Patch not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkSecurityPerimeters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.UpdateTagsRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Patch(req.Context(), resourceGroupNameParam, networkSecurityPerimeterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !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) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to SecurityPerimetersServerTransport +var securityPerimetersServerTransportInterceptor 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/securityrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go index 0bb4bd926b0b..82730e10ed42 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (s *SecurityRulesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityRulesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "SecurityRulesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityRulesClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityRulesClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityRulesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SecurityRulesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityRulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityRulesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (s *SecurityRulesServerTransport) dispatchNewListPager(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityRulesServerTransport +var securityRulesServerTransportInterceptor 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/securityuserconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go index 76d437c0c08a..909bd86f4411 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (s *SecurityUserConfigurationsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityUserConfigurationsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SecurityUserConfigurationsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityUserConfigurationsClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityUserConfigurationsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityUserConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityUserConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityUserConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityUserConfigurationsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityUserConfigurationsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityUserConfigurationsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityUserConfigurationsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityUserConfigurationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -300,3 +316,9 @@ func (s *SecurityUserConfigurationsServerTransport) dispatchNewListPager(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityUserConfigurationsServerTransport +var securityUserConfigurationsServerTransportInterceptor 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/securityuserrulecollections_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go index b0d0f5e38a06..7aa216f6fad9 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrulecollections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (s *SecurityUserRuleCollectionsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityUserRuleCollectionsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SecurityUserRuleCollectionsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityUserRuleCollectionsClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityUserRuleCollectionsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityUserRuleCollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityUserRuleCollectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityUserRuleCollectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityUserRuleCollectionsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityUserRuleCollectionsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityUserRuleCollectionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityUserRuleCollectionsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityUserRuleCollectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -316,3 +332,9 @@ func (s *SecurityUserRuleCollectionsServerTransport) dispatchNewListPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityUserRuleCollectionsServerTransport +var securityUserRuleCollectionsServerTransportInterceptor 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/securityuserrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go index 83fcaaa548c9..755c3a150b93 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/securityuserrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -69,27 +66,46 @@ func (s *SecurityUserRulesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityUserRulesClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SecurityUserRulesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityUserRulesClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityUserRulesClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityUserRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityUserRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityUserRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityUserRulesClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SecurityUserRulesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityUserRulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityUserRulesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityUserRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -332,3 +348,9 @@ func (s *SecurityUserRulesServerTransport) dispatchNewListPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityUserRulesServerTransport +var securityUserRulesServerTransportInterceptor 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/server_factory.go b/sdk/resourcemanager/network/armnetwork/fake/server_factory.go index 182d47d82fbe..1cdaa8dbce86 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/server_factory.go +++ b/sdk/resourcemanager/network/armnetwork/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,153 +16,476 @@ import ( // ServerFactory is a fake server for instances of the armnetwork.ClientFactory type. type ServerFactory struct { - AdminRuleCollectionsServer AdminRuleCollectionsServer - AdminRulesServer AdminRulesServer - ApplicationGatewayPrivateEndpointConnectionsServer ApplicationGatewayPrivateEndpointConnectionsServer - ApplicationGatewayPrivateLinkResourcesServer ApplicationGatewayPrivateLinkResourcesServer - ApplicationGatewayWafDynamicManifestsServer ApplicationGatewayWafDynamicManifestsServer - ApplicationGatewayWafDynamicManifestsDefaultServer ApplicationGatewayWafDynamicManifestsDefaultServer - ApplicationGatewaysServer ApplicationGatewaysServer - ApplicationSecurityGroupsServer ApplicationSecurityGroupsServer - AvailableDelegationsServer AvailableDelegationsServer - AvailableEndpointServicesServer AvailableEndpointServicesServer - AvailablePrivateEndpointTypesServer AvailablePrivateEndpointTypesServer - AvailableResourceGroupDelegationsServer AvailableResourceGroupDelegationsServer - AvailableServiceAliasesServer AvailableServiceAliasesServer - AzureFirewallFqdnTagsServer AzureFirewallFqdnTagsServer - AzureFirewallsServer AzureFirewallsServer - BastionHostsServer BastionHostsServer - BgpServiceCommunitiesServer BgpServiceCommunitiesServer - ConfigurationPolicyGroupsServer ConfigurationPolicyGroupsServer - ConnectionMonitorsServer ConnectionMonitorsServer - ConnectivityConfigurationsServer ConnectivityConfigurationsServer - CustomIPPrefixesServer CustomIPPrefixesServer - DdosCustomPoliciesServer DdosCustomPoliciesServer - DdosProtectionPlansServer DdosProtectionPlansServer - DefaultSecurityRulesServer DefaultSecurityRulesServer - DscpConfigurationServer DscpConfigurationServer - ExpressRouteCircuitAuthorizationsServer ExpressRouteCircuitAuthorizationsServer - ExpressRouteCircuitConnectionsServer ExpressRouteCircuitConnectionsServer - ExpressRouteCircuitPeeringsServer ExpressRouteCircuitPeeringsServer - ExpressRouteCircuitsServer ExpressRouteCircuitsServer - ExpressRouteConnectionsServer ExpressRouteConnectionsServer - ExpressRouteCrossConnectionPeeringsServer ExpressRouteCrossConnectionPeeringsServer - ExpressRouteCrossConnectionsServer ExpressRouteCrossConnectionsServer - ExpressRouteGatewaysServer ExpressRouteGatewaysServer - ExpressRouteLinksServer ExpressRouteLinksServer - ExpressRoutePortAuthorizationsServer ExpressRoutePortAuthorizationsServer - ExpressRoutePortsServer ExpressRoutePortsServer - ExpressRoutePortsLocationsServer ExpressRoutePortsLocationsServer - ExpressRouteProviderPortsLocationServer ExpressRouteProviderPortsLocationServer - ExpressRouteServiceProvidersServer ExpressRouteServiceProvidersServer - FirewallPoliciesServer FirewallPoliciesServer - FirewallPolicyDeploymentsServer FirewallPolicyDeploymentsServer - FirewallPolicyDraftsServer FirewallPolicyDraftsServer - FirewallPolicyIdpsSignaturesServer FirewallPolicyIdpsSignaturesServer - FirewallPolicyIdpsSignaturesFilterValuesServer FirewallPolicyIdpsSignaturesFilterValuesServer - FirewallPolicyIdpsSignaturesOverridesServer FirewallPolicyIdpsSignaturesOverridesServer - FirewallPolicyRuleCollectionGroupDraftsServer FirewallPolicyRuleCollectionGroupDraftsServer - FirewallPolicyRuleCollectionGroupsServer FirewallPolicyRuleCollectionGroupsServer - FlowLogsServer FlowLogsServer - GroupsServer GroupsServer - HubRouteTablesServer HubRouteTablesServer - HubVirtualNetworkConnectionsServer HubVirtualNetworkConnectionsServer - IPAllocationsServer IPAllocationsServer - IPGroupsServer IPGroupsServer - InboundNatRulesServer InboundNatRulesServer - InboundSecurityRuleServer InboundSecurityRuleServer - InterfaceIPConfigurationsServer InterfaceIPConfigurationsServer - InterfaceLoadBalancersServer InterfaceLoadBalancersServer - InterfaceTapConfigurationsServer InterfaceTapConfigurationsServer - InterfacesServer InterfacesServer - IpamPoolsServer IpamPoolsServer - LoadBalancerBackendAddressPoolsServer LoadBalancerBackendAddressPoolsServer - LoadBalancerFrontendIPConfigurationsServer LoadBalancerFrontendIPConfigurationsServer - LoadBalancerLoadBalancingRulesServer LoadBalancerLoadBalancingRulesServer - LoadBalancerNetworkInterfacesServer LoadBalancerNetworkInterfacesServer - LoadBalancerOutboundRulesServer LoadBalancerOutboundRulesServer - LoadBalancerProbesServer LoadBalancerProbesServer - LoadBalancersServer LoadBalancersServer - LocalNetworkGatewaysServer LocalNetworkGatewaysServer - ManagementServer ManagementServer - ManagementGroupNetworkManagerConnectionsServer ManagementGroupNetworkManagerConnectionsServer - ManagerCommitsServer ManagerCommitsServer - ManagerDeploymentStatusServer ManagerDeploymentStatusServer - ManagerRoutingConfigurationsServer ManagerRoutingConfigurationsServer - ManagersServer ManagersServer - NatGatewaysServer NatGatewaysServer - NatRulesServer NatRulesServer - OperationsServer OperationsServer - P2SVPNGatewaysServer P2SVPNGatewaysServer - PacketCapturesServer PacketCapturesServer - PeerExpressRouteCircuitConnectionsServer PeerExpressRouteCircuitConnectionsServer - PrivateDNSZoneGroupsServer PrivateDNSZoneGroupsServer - PrivateEndpointsServer PrivateEndpointsServer - PrivateLinkServicesServer PrivateLinkServicesServer - ProfilesServer ProfilesServer - PublicIPAddressesServer PublicIPAddressesServer - PublicIPPrefixesServer PublicIPPrefixesServer - ReachabilityAnalysisIntentsServer ReachabilityAnalysisIntentsServer - ReachabilityAnalysisRunsServer ReachabilityAnalysisRunsServer - ResourceNavigationLinksServer ResourceNavigationLinksServer - RouteFilterRulesServer RouteFilterRulesServer - RouteFiltersServer RouteFiltersServer - RouteMapsServer RouteMapsServer - RouteTablesServer RouteTablesServer - RoutesServer RoutesServer - RoutingIntentServer RoutingIntentServer - RoutingRuleCollectionsServer RoutingRuleCollectionsServer - RoutingRulesServer RoutingRulesServer - ScopeConnectionsServer ScopeConnectionsServer - SecurityAdminConfigurationsServer SecurityAdminConfigurationsServer - SecurityGroupsServer SecurityGroupsServer - SecurityPartnerProvidersServer SecurityPartnerProvidersServer - SecurityRulesServer SecurityRulesServer - SecurityUserConfigurationsServer SecurityUserConfigurationsServer - SecurityUserRuleCollectionsServer SecurityUserRuleCollectionsServer - SecurityUserRulesServer SecurityUserRulesServer - ServiceAssociationLinksServer ServiceAssociationLinksServer - ServiceEndpointPoliciesServer ServiceEndpointPoliciesServer - ServiceEndpointPolicyDefinitionsServer ServiceEndpointPolicyDefinitionsServer - ServiceTagInformationServer ServiceTagInformationServer - ServiceTagsServer ServiceTagsServer - StaticCidrsServer StaticCidrsServer - StaticMembersServer StaticMembersServer - SubnetsServer SubnetsServer - SubscriptionNetworkManagerConnectionsServer SubscriptionNetworkManagerConnectionsServer - UsagesServer UsagesServer - VPNConnectionsServer VPNConnectionsServer - VPNGatewaysServer VPNGatewaysServer - VPNLinkConnectionsServer VPNLinkConnectionsServer + // AdminRuleCollectionsServer contains the fakes for client AdminRuleCollectionsClient + AdminRuleCollectionsServer AdminRuleCollectionsServer + + // AdminRulesServer contains the fakes for client AdminRulesClient + AdminRulesServer AdminRulesServer + + // ApplicationGatewayPrivateEndpointConnectionsServer contains the fakes for client ApplicationGatewayPrivateEndpointConnectionsClient + ApplicationGatewayPrivateEndpointConnectionsServer ApplicationGatewayPrivateEndpointConnectionsServer + + // ApplicationGatewayPrivateLinkResourcesServer contains the fakes for client ApplicationGatewayPrivateLinkResourcesClient + ApplicationGatewayPrivateLinkResourcesServer ApplicationGatewayPrivateLinkResourcesServer + + // ApplicationGatewayWafDynamicManifestsServer contains the fakes for client ApplicationGatewayWafDynamicManifestsClient + ApplicationGatewayWafDynamicManifestsServer ApplicationGatewayWafDynamicManifestsServer + + // ApplicationGatewayWafDynamicManifestsDefaultServer contains the fakes for client ApplicationGatewayWafDynamicManifestsDefaultClient + ApplicationGatewayWafDynamicManifestsDefaultServer ApplicationGatewayWafDynamicManifestsDefaultServer + + // ApplicationGatewaysServer contains the fakes for client ApplicationGatewaysClient + ApplicationGatewaysServer ApplicationGatewaysServer + + // ApplicationSecurityGroupsServer contains the fakes for client ApplicationSecurityGroupsClient + ApplicationSecurityGroupsServer ApplicationSecurityGroupsServer + + // AvailableDelegationsServer contains the fakes for client AvailableDelegationsClient + AvailableDelegationsServer AvailableDelegationsServer + + // AvailableEndpointServicesServer contains the fakes for client AvailableEndpointServicesClient + AvailableEndpointServicesServer AvailableEndpointServicesServer + + // AvailablePrivateEndpointTypesServer contains the fakes for client AvailablePrivateEndpointTypesClient + AvailablePrivateEndpointTypesServer AvailablePrivateEndpointTypesServer + + // AvailableResourceGroupDelegationsServer contains the fakes for client AvailableResourceGroupDelegationsClient + AvailableResourceGroupDelegationsServer AvailableResourceGroupDelegationsServer + + // AvailableServiceAliasesServer contains the fakes for client AvailableServiceAliasesClient + AvailableServiceAliasesServer AvailableServiceAliasesServer + + // AzureFirewallFqdnTagsServer contains the fakes for client AzureFirewallFqdnTagsClient + AzureFirewallFqdnTagsServer AzureFirewallFqdnTagsServer + + // AzureFirewallsServer contains the fakes for client AzureFirewallsClient + AzureFirewallsServer AzureFirewallsServer + + // BastionHostsServer contains the fakes for client BastionHostsClient + BastionHostsServer BastionHostsServer + + // BgpServiceCommunitiesServer contains the fakes for client BgpServiceCommunitiesClient + BgpServiceCommunitiesServer BgpServiceCommunitiesServer + + // ConfigurationPolicyGroupsServer contains the fakes for client ConfigurationPolicyGroupsClient + ConfigurationPolicyGroupsServer ConfigurationPolicyGroupsServer + + // ConnectionMonitorsServer contains the fakes for client ConnectionMonitorsClient + ConnectionMonitorsServer ConnectionMonitorsServer + + // ConnectivityConfigurationsServer contains the fakes for client ConnectivityConfigurationsClient + ConnectivityConfigurationsServer ConnectivityConfigurationsServer + + // CustomIPPrefixesServer contains the fakes for client CustomIPPrefixesClient + CustomIPPrefixesServer CustomIPPrefixesServer + + // DdosCustomPoliciesServer contains the fakes for client DdosCustomPoliciesClient + DdosCustomPoliciesServer DdosCustomPoliciesServer + + // DdosProtectionPlansServer contains the fakes for client DdosProtectionPlansClient + DdosProtectionPlansServer DdosProtectionPlansServer + + // DefaultSecurityRulesServer contains the fakes for client DefaultSecurityRulesClient + DefaultSecurityRulesServer DefaultSecurityRulesServer + + // DscpConfigurationServer contains the fakes for client DscpConfigurationClient + DscpConfigurationServer DscpConfigurationServer + + // ExpressRouteCircuitAuthorizationsServer contains the fakes for client ExpressRouteCircuitAuthorizationsClient + ExpressRouteCircuitAuthorizationsServer ExpressRouteCircuitAuthorizationsServer + + // ExpressRouteCircuitConnectionsServer contains the fakes for client ExpressRouteCircuitConnectionsClient + ExpressRouteCircuitConnectionsServer ExpressRouteCircuitConnectionsServer + + // ExpressRouteCircuitPeeringsServer contains the fakes for client ExpressRouteCircuitPeeringsClient + ExpressRouteCircuitPeeringsServer ExpressRouteCircuitPeeringsServer + + // ExpressRouteCircuitsServer contains the fakes for client ExpressRouteCircuitsClient + ExpressRouteCircuitsServer ExpressRouteCircuitsServer + + // ExpressRouteConnectionsServer contains the fakes for client ExpressRouteConnectionsClient + ExpressRouteConnectionsServer ExpressRouteConnectionsServer + + // ExpressRouteCrossConnectionPeeringsServer contains the fakes for client ExpressRouteCrossConnectionPeeringsClient + ExpressRouteCrossConnectionPeeringsServer ExpressRouteCrossConnectionPeeringsServer + + // ExpressRouteCrossConnectionsServer contains the fakes for client ExpressRouteCrossConnectionsClient + ExpressRouteCrossConnectionsServer ExpressRouteCrossConnectionsServer + + // ExpressRouteGatewaysServer contains the fakes for client ExpressRouteGatewaysClient + ExpressRouteGatewaysServer ExpressRouteGatewaysServer + + // ExpressRouteLinksServer contains the fakes for client ExpressRouteLinksClient + ExpressRouteLinksServer ExpressRouteLinksServer + + // ExpressRoutePortAuthorizationsServer contains the fakes for client ExpressRoutePortAuthorizationsClient + ExpressRoutePortAuthorizationsServer ExpressRoutePortAuthorizationsServer + + // ExpressRoutePortsServer contains the fakes for client ExpressRoutePortsClient + ExpressRoutePortsServer ExpressRoutePortsServer + + // ExpressRoutePortsLocationsServer contains the fakes for client ExpressRoutePortsLocationsClient + ExpressRoutePortsLocationsServer ExpressRoutePortsLocationsServer + + // ExpressRouteProviderPortsLocationServer contains the fakes for client ExpressRouteProviderPortsLocationClient + ExpressRouteProviderPortsLocationServer ExpressRouteProviderPortsLocationServer + + // ExpressRouteServiceProvidersServer contains the fakes for client ExpressRouteServiceProvidersClient + ExpressRouteServiceProvidersServer ExpressRouteServiceProvidersServer + + // FirewallPoliciesServer contains the fakes for client FirewallPoliciesClient + FirewallPoliciesServer FirewallPoliciesServer + + // FirewallPolicyDeploymentsServer contains the fakes for client FirewallPolicyDeploymentsClient + FirewallPolicyDeploymentsServer FirewallPolicyDeploymentsServer + + // FirewallPolicyDraftsServer contains the fakes for client FirewallPolicyDraftsClient + FirewallPolicyDraftsServer FirewallPolicyDraftsServer + + // FirewallPolicyIdpsSignaturesServer contains the fakes for client FirewallPolicyIdpsSignaturesClient + FirewallPolicyIdpsSignaturesServer FirewallPolicyIdpsSignaturesServer + + // FirewallPolicyIdpsSignaturesFilterValuesServer contains the fakes for client FirewallPolicyIdpsSignaturesFilterValuesClient + FirewallPolicyIdpsSignaturesFilterValuesServer FirewallPolicyIdpsSignaturesFilterValuesServer + + // FirewallPolicyIdpsSignaturesOverridesServer contains the fakes for client FirewallPolicyIdpsSignaturesOverridesClient + FirewallPolicyIdpsSignaturesOverridesServer FirewallPolicyIdpsSignaturesOverridesServer + + // FirewallPolicyRuleCollectionGroupDraftsServer contains the fakes for client FirewallPolicyRuleCollectionGroupDraftsClient + FirewallPolicyRuleCollectionGroupDraftsServer FirewallPolicyRuleCollectionGroupDraftsServer + + // FirewallPolicyRuleCollectionGroupsServer contains the fakes for client FirewallPolicyRuleCollectionGroupsClient + FirewallPolicyRuleCollectionGroupsServer FirewallPolicyRuleCollectionGroupsServer + + // FlowLogsServer contains the fakes for client FlowLogsClient + FlowLogsServer FlowLogsServer + + // GroupsServer contains the fakes for client GroupsClient + GroupsServer GroupsServer + + // HubRouteTablesServer contains the fakes for client HubRouteTablesClient + HubRouteTablesServer HubRouteTablesServer + + // HubVirtualNetworkConnectionsServer contains the fakes for client HubVirtualNetworkConnectionsClient + HubVirtualNetworkConnectionsServer HubVirtualNetworkConnectionsServer + + // IPAllocationsServer contains the fakes for client IPAllocationsClient + IPAllocationsServer IPAllocationsServer + + // IPGroupsServer contains the fakes for client IPGroupsClient + IPGroupsServer IPGroupsServer + + // InboundNatRulesServer contains the fakes for client InboundNatRulesClient + InboundNatRulesServer InboundNatRulesServer + + // InboundSecurityRuleServer contains the fakes for client InboundSecurityRuleClient + InboundSecurityRuleServer InboundSecurityRuleServer + + // InterfaceIPConfigurationsServer contains the fakes for client InterfaceIPConfigurationsClient + InterfaceIPConfigurationsServer InterfaceIPConfigurationsServer + + // InterfaceLoadBalancersServer contains the fakes for client InterfaceLoadBalancersClient + InterfaceLoadBalancersServer InterfaceLoadBalancersServer + + // InterfaceTapConfigurationsServer contains the fakes for client InterfaceTapConfigurationsClient + InterfaceTapConfigurationsServer InterfaceTapConfigurationsServer + + // InterfacesServer contains the fakes for client InterfacesClient + InterfacesServer InterfacesServer + + // IpamPoolsServer contains the fakes for client IpamPoolsClient + IpamPoolsServer IpamPoolsServer + + // LoadBalancerBackendAddressPoolsServer contains the fakes for client LoadBalancerBackendAddressPoolsClient + LoadBalancerBackendAddressPoolsServer LoadBalancerBackendAddressPoolsServer + + // LoadBalancerFrontendIPConfigurationsServer contains the fakes for client LoadBalancerFrontendIPConfigurationsClient + LoadBalancerFrontendIPConfigurationsServer LoadBalancerFrontendIPConfigurationsServer + + // LoadBalancerLoadBalancingRulesServer contains the fakes for client LoadBalancerLoadBalancingRulesClient + LoadBalancerLoadBalancingRulesServer LoadBalancerLoadBalancingRulesServer + + // LoadBalancerNetworkInterfacesServer contains the fakes for client LoadBalancerNetworkInterfacesClient + LoadBalancerNetworkInterfacesServer LoadBalancerNetworkInterfacesServer + + // LoadBalancerOutboundRulesServer contains the fakes for client LoadBalancerOutboundRulesClient + LoadBalancerOutboundRulesServer LoadBalancerOutboundRulesServer + + // LoadBalancerProbesServer contains the fakes for client LoadBalancerProbesClient + LoadBalancerProbesServer LoadBalancerProbesServer + + // LoadBalancersServer contains the fakes for client LoadBalancersClient + LoadBalancersServer LoadBalancersServer + + // LocalNetworkGatewaysServer contains the fakes for client LocalNetworkGatewaysClient + LocalNetworkGatewaysServer LocalNetworkGatewaysServer + + // ManagementServer contains the fakes for client ManagementClient + ManagementServer ManagementServer + + // ManagementGroupNetworkManagerConnectionsServer contains the fakes for client ManagementGroupNetworkManagerConnectionsClient + ManagementGroupNetworkManagerConnectionsServer ManagementGroupNetworkManagerConnectionsServer + + // ManagerCommitsServer contains the fakes for client ManagerCommitsClient + ManagerCommitsServer ManagerCommitsServer + + // ManagerDeploymentStatusServer contains the fakes for client ManagerDeploymentStatusClient + ManagerDeploymentStatusServer ManagerDeploymentStatusServer + + // ManagerRoutingConfigurationsServer contains the fakes for client ManagerRoutingConfigurationsClient + ManagerRoutingConfigurationsServer ManagerRoutingConfigurationsServer + + // ManagersServer contains the fakes for client ManagersClient + ManagersServer ManagersServer + + // NatGatewaysServer contains the fakes for client NatGatewaysClient + NatGatewaysServer NatGatewaysServer + + // NatRulesServer contains the fakes for client NatRulesClient + NatRulesServer NatRulesServer + + // NspAssociationReconcileServer contains the fakes for client NspAssociationReconcileClient + NspAssociationReconcileServer NspAssociationReconcileServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // P2SVPNGatewaysServer contains the fakes for client P2SVPNGatewaysClient + P2SVPNGatewaysServer P2SVPNGatewaysServer + + // PacketCapturesServer contains the fakes for client PacketCapturesClient + PacketCapturesServer PacketCapturesServer + + // PeerExpressRouteCircuitConnectionsServer contains the fakes for client PeerExpressRouteCircuitConnectionsClient + PeerExpressRouteCircuitConnectionsServer PeerExpressRouteCircuitConnectionsServer + + // PrivateDNSZoneGroupsServer contains the fakes for client PrivateDNSZoneGroupsClient + PrivateDNSZoneGroupsServer PrivateDNSZoneGroupsServer + + // PrivateEndpointsServer contains the fakes for client PrivateEndpointsClient + PrivateEndpointsServer PrivateEndpointsServer + + // PrivateLinkServicesServer contains the fakes for client PrivateLinkServicesClient + PrivateLinkServicesServer PrivateLinkServicesServer + + // ProfilesServer contains the fakes for client ProfilesClient + ProfilesServer ProfilesServer + + // PublicIPAddressesServer contains the fakes for client PublicIPAddressesClient + PublicIPAddressesServer PublicIPAddressesServer + + // PublicIPPrefixesServer contains the fakes for client PublicIPPrefixesClient + PublicIPPrefixesServer PublicIPPrefixesServer + + // ReachabilityAnalysisIntentsServer contains the fakes for client ReachabilityAnalysisIntentsClient + ReachabilityAnalysisIntentsServer ReachabilityAnalysisIntentsServer + + // ReachabilityAnalysisRunsServer contains the fakes for client ReachabilityAnalysisRunsClient + ReachabilityAnalysisRunsServer ReachabilityAnalysisRunsServer + + // ResourceNavigationLinksServer contains the fakes for client ResourceNavigationLinksClient + ResourceNavigationLinksServer ResourceNavigationLinksServer + + // RouteFilterRulesServer contains the fakes for client RouteFilterRulesClient + RouteFilterRulesServer RouteFilterRulesServer + + // RouteFiltersServer contains the fakes for client RouteFiltersClient + RouteFiltersServer RouteFiltersServer + + // RouteMapsServer contains the fakes for client RouteMapsClient + RouteMapsServer RouteMapsServer + + // RouteTablesServer contains the fakes for client RouteTablesClient + RouteTablesServer RouteTablesServer + + // RoutesServer contains the fakes for client RoutesClient + RoutesServer RoutesServer + + // RoutingIntentServer contains the fakes for client RoutingIntentClient + RoutingIntentServer RoutingIntentServer + + // RoutingRuleCollectionsServer contains the fakes for client RoutingRuleCollectionsClient + RoutingRuleCollectionsServer RoutingRuleCollectionsServer + + // RoutingRulesServer contains the fakes for client RoutingRulesClient + RoutingRulesServer RoutingRulesServer + + // ScopeConnectionsServer contains the fakes for client ScopeConnectionsClient + ScopeConnectionsServer ScopeConnectionsServer + + // SecurityAdminConfigurationsServer contains the fakes for client SecurityAdminConfigurationsClient + SecurityAdminConfigurationsServer SecurityAdminConfigurationsServer + + // SecurityGroupsServer contains the fakes for client SecurityGroupsClient + SecurityGroupsServer SecurityGroupsServer + + // SecurityPartnerProvidersServer contains the fakes for client SecurityPartnerProvidersClient + SecurityPartnerProvidersServer SecurityPartnerProvidersServer + + // SecurityPerimeterAccessRulesServer contains the fakes for client SecurityPerimeterAccessRulesClient + SecurityPerimeterAccessRulesServer SecurityPerimeterAccessRulesServer + + // SecurityPerimeterAssociableResourceTypesServer contains the fakes for client SecurityPerimeterAssociableResourceTypesClient + SecurityPerimeterAssociableResourceTypesServer SecurityPerimeterAssociableResourceTypesServer + + // SecurityPerimeterAssociationsServer contains the fakes for client SecurityPerimeterAssociationsClient + SecurityPerimeterAssociationsServer SecurityPerimeterAssociationsServer + + // SecurityPerimeterLinkReferencesServer contains the fakes for client SecurityPerimeterLinkReferencesClient + SecurityPerimeterLinkReferencesServer SecurityPerimeterLinkReferencesServer + + // SecurityPerimeterLinksServer contains the fakes for client SecurityPerimeterLinksClient + SecurityPerimeterLinksServer SecurityPerimeterLinksServer + + // SecurityPerimeterLoggingConfigurationsServer contains the fakes for client SecurityPerimeterLoggingConfigurationsClient + SecurityPerimeterLoggingConfigurationsServer SecurityPerimeterLoggingConfigurationsServer + + // SecurityPerimeterOperationStatusesServer contains the fakes for client SecurityPerimeterOperationStatusesClient + SecurityPerimeterOperationStatusesServer SecurityPerimeterOperationStatusesServer + + // SecurityPerimeterProfilesServer contains the fakes for client SecurityPerimeterProfilesClient + SecurityPerimeterProfilesServer SecurityPerimeterProfilesServer + + // SecurityPerimetersServer contains the fakes for client SecurityPerimetersClient + SecurityPerimetersServer SecurityPerimetersServer + + // SecurityRulesServer contains the fakes for client SecurityRulesClient + SecurityRulesServer SecurityRulesServer + + // SecurityUserConfigurationsServer contains the fakes for client SecurityUserConfigurationsClient + SecurityUserConfigurationsServer SecurityUserConfigurationsServer + + // SecurityUserRuleCollectionsServer contains the fakes for client SecurityUserRuleCollectionsClient + SecurityUserRuleCollectionsServer SecurityUserRuleCollectionsServer + + // SecurityUserRulesServer contains the fakes for client SecurityUserRulesClient + SecurityUserRulesServer SecurityUserRulesServer + + // ServiceAssociationLinksServer contains the fakes for client ServiceAssociationLinksClient + ServiceAssociationLinksServer ServiceAssociationLinksServer + + // ServiceEndpointPoliciesServer contains the fakes for client ServiceEndpointPoliciesClient + ServiceEndpointPoliciesServer ServiceEndpointPoliciesServer + + // ServiceEndpointPolicyDefinitionsServer contains the fakes for client ServiceEndpointPolicyDefinitionsClient + ServiceEndpointPolicyDefinitionsServer ServiceEndpointPolicyDefinitionsServer + + // ServiceTagInformationServer contains the fakes for client ServiceTagInformationClient + ServiceTagInformationServer ServiceTagInformationServer + + // ServiceTagsServer contains the fakes for client ServiceTagsClient + ServiceTagsServer ServiceTagsServer + + // StaticCidrsServer contains the fakes for client StaticCidrsClient + StaticCidrsServer StaticCidrsServer + + // StaticMembersServer contains the fakes for client StaticMembersClient + StaticMembersServer StaticMembersServer + + // SubnetsServer contains the fakes for client SubnetsClient + SubnetsServer SubnetsServer + + // SubscriptionNetworkManagerConnectionsServer contains the fakes for client SubscriptionNetworkManagerConnectionsClient + SubscriptionNetworkManagerConnectionsServer SubscriptionNetworkManagerConnectionsServer + + // UsagesServer contains the fakes for client UsagesClient + UsagesServer UsagesServer + + // VPNConnectionsServer contains the fakes for client VPNConnectionsClient + VPNConnectionsServer VPNConnectionsServer + + // VPNGatewaysServer contains the fakes for client VPNGatewaysClient + VPNGatewaysServer VPNGatewaysServer + + // VPNLinkConnectionsServer contains the fakes for client VPNLinkConnectionsClient + VPNLinkConnectionsServer VPNLinkConnectionsServer + + // VPNServerConfigurationsAssociatedWithVirtualWanServer contains the fakes for client VPNServerConfigurationsAssociatedWithVirtualWanClient VPNServerConfigurationsAssociatedWithVirtualWanServer VPNServerConfigurationsAssociatedWithVirtualWanServer - VPNServerConfigurationsServer VPNServerConfigurationsServer - VPNSiteLinkConnectionsServer VPNSiteLinkConnectionsServer - VPNSiteLinksServer VPNSiteLinksServer - VPNSitesServer VPNSitesServer - VPNSitesConfigurationServer VPNSitesConfigurationServer - VerifierWorkspacesServer VerifierWorkspacesServer - VipSwapServer VipSwapServer - VirtualApplianceConnectionsServer VirtualApplianceConnectionsServer - VirtualApplianceSKUsServer VirtualApplianceSKUsServer - VirtualApplianceSitesServer VirtualApplianceSitesServer - VirtualAppliancesServer VirtualAppliancesServer - VirtualHubBgpConnectionServer VirtualHubBgpConnectionServer - VirtualHubBgpConnectionsServer VirtualHubBgpConnectionsServer - VirtualHubIPConfigurationServer VirtualHubIPConfigurationServer - VirtualHubRouteTableV2SServer VirtualHubRouteTableV2SServer - VirtualHubsServer VirtualHubsServer - VirtualNetworkGatewayConnectionsServer VirtualNetworkGatewayConnectionsServer - VirtualNetworkGatewayNatRulesServer VirtualNetworkGatewayNatRulesServer - VirtualNetworkGatewaysServer VirtualNetworkGatewaysServer - VirtualNetworkPeeringsServer VirtualNetworkPeeringsServer - VirtualNetworkTapsServer VirtualNetworkTapsServer - VirtualNetworksServer VirtualNetworksServer - VirtualRouterPeeringsServer VirtualRouterPeeringsServer - VirtualRoutersServer VirtualRoutersServer - VirtualWansServer VirtualWansServer - WatchersServer WatchersServer - WebApplicationFirewallPoliciesServer WebApplicationFirewallPoliciesServer - WebCategoriesServer WebCategoriesServer + + // VPNServerConfigurationsServer contains the fakes for client VPNServerConfigurationsClient + VPNServerConfigurationsServer VPNServerConfigurationsServer + + // VPNSiteLinkConnectionsServer contains the fakes for client VPNSiteLinkConnectionsClient + VPNSiteLinkConnectionsServer VPNSiteLinkConnectionsServer + + // VPNSiteLinksServer contains the fakes for client VPNSiteLinksClient + VPNSiteLinksServer VPNSiteLinksServer + + // VPNSitesServer contains the fakes for client VPNSitesClient + VPNSitesServer VPNSitesServer + + // VPNSitesConfigurationServer contains the fakes for client VPNSitesConfigurationClient + VPNSitesConfigurationServer VPNSitesConfigurationServer + + // VerifierWorkspacesServer contains the fakes for client VerifierWorkspacesClient + VerifierWorkspacesServer VerifierWorkspacesServer + + // VipSwapServer contains the fakes for client VipSwapClient + VipSwapServer VipSwapServer + + // VirtualApplianceConnectionsServer contains the fakes for client VirtualApplianceConnectionsClient + VirtualApplianceConnectionsServer VirtualApplianceConnectionsServer + + // VirtualApplianceSKUsServer contains the fakes for client VirtualApplianceSKUsClient + VirtualApplianceSKUsServer VirtualApplianceSKUsServer + + // VirtualApplianceSitesServer contains the fakes for client VirtualApplianceSitesClient + VirtualApplianceSitesServer VirtualApplianceSitesServer + + // VirtualAppliancesServer contains the fakes for client VirtualAppliancesClient + VirtualAppliancesServer VirtualAppliancesServer + + // VirtualHubBgpConnectionServer contains the fakes for client VirtualHubBgpConnectionClient + VirtualHubBgpConnectionServer VirtualHubBgpConnectionServer + + // VirtualHubBgpConnectionsServer contains the fakes for client VirtualHubBgpConnectionsClient + VirtualHubBgpConnectionsServer VirtualHubBgpConnectionsServer + + // VirtualHubIPConfigurationServer contains the fakes for client VirtualHubIPConfigurationClient + VirtualHubIPConfigurationServer VirtualHubIPConfigurationServer + + // VirtualHubRouteTableV2SServer contains the fakes for client VirtualHubRouteTableV2SClient + VirtualHubRouteTableV2SServer VirtualHubRouteTableV2SServer + + // VirtualHubsServer contains the fakes for client VirtualHubsClient + VirtualHubsServer VirtualHubsServer + + // VirtualNetworkGatewayConnectionsServer contains the fakes for client VirtualNetworkGatewayConnectionsClient + VirtualNetworkGatewayConnectionsServer VirtualNetworkGatewayConnectionsServer + + // VirtualNetworkGatewayNatRulesServer contains the fakes for client VirtualNetworkGatewayNatRulesClient + VirtualNetworkGatewayNatRulesServer VirtualNetworkGatewayNatRulesServer + + // VirtualNetworkGatewaysServer contains the fakes for client VirtualNetworkGatewaysClient + VirtualNetworkGatewaysServer VirtualNetworkGatewaysServer + + // VirtualNetworkPeeringsServer contains the fakes for client VirtualNetworkPeeringsClient + VirtualNetworkPeeringsServer VirtualNetworkPeeringsServer + + // VirtualNetworkTapsServer contains the fakes for client VirtualNetworkTapsClient + VirtualNetworkTapsServer VirtualNetworkTapsServer + + // VirtualNetworksServer contains the fakes for client VirtualNetworksClient + VirtualNetworksServer VirtualNetworksServer + + // VirtualRouterPeeringsServer contains the fakes for client VirtualRouterPeeringsClient + VirtualRouterPeeringsServer VirtualRouterPeeringsServer + + // VirtualRoutersServer contains the fakes for client VirtualRoutersClient + VirtualRoutersServer VirtualRoutersServer + + // VirtualWansServer contains the fakes for client VirtualWansClient + VirtualWansServer VirtualWansServer + + // WatchersServer contains the fakes for client WatchersClient + WatchersServer WatchersServer + + // WebApplicationFirewallPoliciesServer contains the fakes for client WebApplicationFirewallPoliciesClient + WebApplicationFirewallPoliciesServer WebApplicationFirewallPoliciesServer + + // WebCategoriesServer contains the fakes for client WebCategoriesClient + WebCategoriesServer WebCategoriesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -258,6 +578,7 @@ type ServerFactoryTransport struct { trManagersServer *ManagersServerTransport trNatGatewaysServer *NatGatewaysServerTransport trNatRulesServer *NatRulesServerTransport + trNspAssociationReconcileServer *NspAssociationReconcileServerTransport trOperationsServer *OperationsServerTransport trP2SVPNGatewaysServer *P2SVPNGatewaysServerTransport trPacketCapturesServer *PacketCapturesServerTransport @@ -283,6 +604,15 @@ type ServerFactoryTransport struct { trSecurityAdminConfigurationsServer *SecurityAdminConfigurationsServerTransport trSecurityGroupsServer *SecurityGroupsServerTransport trSecurityPartnerProvidersServer *SecurityPartnerProvidersServerTransport + trSecurityPerimeterAccessRulesServer *SecurityPerimeterAccessRulesServerTransport + trSecurityPerimeterAssociableResourceTypesServer *SecurityPerimeterAssociableResourceTypesServerTransport + trSecurityPerimeterAssociationsServer *SecurityPerimeterAssociationsServerTransport + trSecurityPerimeterLinkReferencesServer *SecurityPerimeterLinkReferencesServerTransport + trSecurityPerimeterLinksServer *SecurityPerimeterLinksServerTransport + trSecurityPerimeterLoggingConfigurationsServer *SecurityPerimeterLoggingConfigurationsServerTransport + trSecurityPerimeterOperationStatusesServer *SecurityPerimeterOperationStatusesServerTransport + trSecurityPerimeterProfilesServer *SecurityPerimeterProfilesServerTransport + trSecurityPerimetersServer *SecurityPerimetersServerTransport trSecurityRulesServer *SecurityRulesServerTransport trSecurityUserConfigurationsServer *SecurityUserConfigurationsServerTransport trSecurityUserRuleCollectionsServer *SecurityUserRuleCollectionsServerTransport @@ -702,6 +1032,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "NatRulesClient": initServer(s, &s.trNatRulesServer, func() *NatRulesServerTransport { return NewNatRulesServerTransport(&s.srv.NatRulesServer) }) resp, err = s.trNatRulesServer.Do(req) + case "NspAssociationReconcileClient": + initServer(s, &s.trNspAssociationReconcileServer, func() *NspAssociationReconcileServerTransport { + return NewNspAssociationReconcileServerTransport(&s.srv.NspAssociationReconcileServer) + }) + resp, err = s.trNspAssociationReconcileServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -813,6 +1148,51 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewSecurityPartnerProvidersServerTransport(&s.srv.SecurityPartnerProvidersServer) }) resp, err = s.trSecurityPartnerProvidersServer.Do(req) + case "SecurityPerimeterAccessRulesClient": + initServer(s, &s.trSecurityPerimeterAccessRulesServer, func() *SecurityPerimeterAccessRulesServerTransport { + return NewSecurityPerimeterAccessRulesServerTransport(&s.srv.SecurityPerimeterAccessRulesServer) + }) + resp, err = s.trSecurityPerimeterAccessRulesServer.Do(req) + case "SecurityPerimeterAssociableResourceTypesClient": + initServer(s, &s.trSecurityPerimeterAssociableResourceTypesServer, func() *SecurityPerimeterAssociableResourceTypesServerTransport { + return NewSecurityPerimeterAssociableResourceTypesServerTransport(&s.srv.SecurityPerimeterAssociableResourceTypesServer) + }) + resp, err = s.trSecurityPerimeterAssociableResourceTypesServer.Do(req) + case "SecurityPerimeterAssociationsClient": + initServer(s, &s.trSecurityPerimeterAssociationsServer, func() *SecurityPerimeterAssociationsServerTransport { + return NewSecurityPerimeterAssociationsServerTransport(&s.srv.SecurityPerimeterAssociationsServer) + }) + resp, err = s.trSecurityPerimeterAssociationsServer.Do(req) + case "SecurityPerimeterLinkReferencesClient": + initServer(s, &s.trSecurityPerimeterLinkReferencesServer, func() *SecurityPerimeterLinkReferencesServerTransport { + return NewSecurityPerimeterLinkReferencesServerTransport(&s.srv.SecurityPerimeterLinkReferencesServer) + }) + resp, err = s.trSecurityPerimeterLinkReferencesServer.Do(req) + case "SecurityPerimeterLinksClient": + initServer(s, &s.trSecurityPerimeterLinksServer, func() *SecurityPerimeterLinksServerTransport { + return NewSecurityPerimeterLinksServerTransport(&s.srv.SecurityPerimeterLinksServer) + }) + resp, err = s.trSecurityPerimeterLinksServer.Do(req) + case "SecurityPerimeterLoggingConfigurationsClient": + initServer(s, &s.trSecurityPerimeterLoggingConfigurationsServer, func() *SecurityPerimeterLoggingConfigurationsServerTransport { + return NewSecurityPerimeterLoggingConfigurationsServerTransport(&s.srv.SecurityPerimeterLoggingConfigurationsServer) + }) + resp, err = s.trSecurityPerimeterLoggingConfigurationsServer.Do(req) + case "SecurityPerimeterOperationStatusesClient": + initServer(s, &s.trSecurityPerimeterOperationStatusesServer, func() *SecurityPerimeterOperationStatusesServerTransport { + return NewSecurityPerimeterOperationStatusesServerTransport(&s.srv.SecurityPerimeterOperationStatusesServer) + }) + resp, err = s.trSecurityPerimeterOperationStatusesServer.Do(req) + case "SecurityPerimeterProfilesClient": + initServer(s, &s.trSecurityPerimeterProfilesServer, func() *SecurityPerimeterProfilesServerTransport { + return NewSecurityPerimeterProfilesServerTransport(&s.srv.SecurityPerimeterProfilesServer) + }) + resp, err = s.trSecurityPerimeterProfilesServer.Do(req) + case "SecurityPerimetersClient": + initServer(s, &s.trSecurityPerimetersServer, func() *SecurityPerimetersServerTransport { + return NewSecurityPerimetersServerTransport(&s.srv.SecurityPerimetersServer) + }) + resp, err = s.trSecurityPerimetersServer.Do(req) case "SecurityRulesClient": initServer(s, &s.trSecurityRulesServer, func() *SecurityRulesServerTransport { return NewSecurityRulesServerTransport(&s.srv.SecurityRulesServer) diff --git a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go index de590dcc90bc..e7063e6c2464 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceassociationlinks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (s *ServiceAssociationLinksServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServiceAssociationLinksClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServiceAssociationLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serviceAssociationLinksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serviceAssociationLinksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServiceAssociationLinksClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServiceAssociationLinksServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (s *ServiceAssociationLinksServerTransport) dispatchList(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ServiceAssociationLinksServerTransport +var serviceAssociationLinksServerTransportInterceptor 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/serviceendpointpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go index cce990df11ad..1f8f0583879c 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (s *ServiceEndpointPoliciesServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServiceEndpointPoliciesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServiceEndpointPoliciesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServiceEndpointPoliciesClient.Get": - resp, err = s.dispatchGet(req) - case "ServiceEndpointPoliciesClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "ServiceEndpointPoliciesClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ServiceEndpointPoliciesClient.UpdateTags": - resp, err = s.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServiceEndpointPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serviceEndpointPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serviceEndpointPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServiceEndpointPoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServiceEndpointPoliciesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServiceEndpointPoliciesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServiceEndpointPoliciesClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "ServiceEndpointPoliciesClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ServiceEndpointPoliciesClient.UpdateTags": + res.resp, res.err = s.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServiceEndpointPoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (s *ServiceEndpointPoliciesServerTransport) dispatchUpdateTags(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ServiceEndpointPoliciesServerTransport +var serviceEndpointPoliciesServerTransportInterceptor 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/serviceendpointpolicydefinitions_server.go b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go index b98583aff419..e326ae625636 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/serviceendpointpolicydefinitions_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServiceEndpointPolicyDefinitionsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServiceEndpointPolicyDefinitionsClient.Get": - resp, err = s.dispatchGet(req) - case "ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serviceEndpointPolicyDefinitionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serviceEndpointPolicyDefinitionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServiceEndpointPolicyDefinitionsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServiceEndpointPolicyDefinitionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (s *ServiceEndpointPolicyDefinitionsServerTransport) dispatchNewListByResou } return resp, nil } + +// set this to conditionally intercept incoming requests to ServiceEndpointPolicyDefinitionsServerTransport +var serviceEndpointPolicyDefinitionsServerTransportInterceptor 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/servicetaginformation_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go index 580b965d4b46..4c117915cfed 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetaginformation_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -54,21 +51,40 @@ func (s *ServiceTagInformationServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServiceTagInformationClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServiceTagInformationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serviceTagInformationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serviceTagInformationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServiceTagInformationClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServiceTagInformationServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -128,3 +144,9 @@ func (s *ServiceTagInformationServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ServiceTagInformationServerTransport +var serviceTagInformationServerTransportInterceptor 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/servicetags_server.go b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go index 59a84e80d161..9f4791409974 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/servicetags_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (s *ServiceTagsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServiceTagsClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServiceTagsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serviceTagsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serviceTagsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServiceTagsClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServiceTagsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (s *ServiceTagsServerTransport) dispatchList(req *http.Request) (*http.Resp } return resp, nil } + +// set this to conditionally intercept incoming requests to ServiceTagsServerTransport +var serviceTagsServerTransportInterceptor 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/staticcidrs_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go index f2517ca99509..a53ccf79e20d 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticcidrs_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -31,7 +28,7 @@ type StaticCidrsServer struct { Create func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, 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.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *armnetwork.StaticCidrsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.StaticCidrsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method StaticCidrsClient.Get @@ -70,27 +67,46 @@ func (s *StaticCidrsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "StaticCidrsClient.Create": - resp, err = s.dispatchCreate(req) - case "StaticCidrsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "StaticCidrsClient.Get": - resp, err = s.dispatchGet(req) - case "StaticCidrsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *StaticCidrsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if staticCidrsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = staticCidrsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StaticCidrsClient.Create": + res.resp, res.err = s.dispatchCreate(req) + case "StaticCidrsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "StaticCidrsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "StaticCidrsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *StaticCidrsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -185,9 +201,9 @@ func (s *StaticCidrsServerTransport) dispatchBeginDelete(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { s.beginDelete.remove(req) @@ -335,3 +351,9 @@ func (s *StaticCidrsServerTransport) dispatchNewListPager(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to StaticCidrsServerTransport +var staticCidrsServerTransportInterceptor 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/staticmembers_server.go b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go index ccb1202c0b6f..a2eb54636286 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/staticmembers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (s *StaticMembersServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "StaticMembersClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "StaticMembersClient.Delete": - resp, err = s.dispatchDelete(req) - case "StaticMembersClient.Get": - resp, err = s.dispatchGet(req) - case "StaticMembersClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *StaticMembersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if staticMembersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = staticMembersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StaticMembersClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "StaticMembersClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "StaticMembersClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "StaticMembersClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *StaticMembersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -288,3 +304,9 @@ func (s *StaticMembersServerTransport) dispatchNewListPager(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to StaticMembersServerTransport +var staticMembersServerTransportInterceptor 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 0fb03971fd97..00ee191f7653 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subnets_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -41,11 +38,11 @@ type SubnetsServer struct { NewListPager func(resourceGroupName string, virtualNetworkName string, options *armnetwork.SubnetsClientListOptions) (resp azfake.PagerResponder[armnetwork.SubnetsClientListResponse]) // BeginPrepareNetworkPolicies is the fake for method SubnetsClient.BeginPrepareNetworkPolicies - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPrepareNetworkPolicies func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters armnetwork.PrepareNetworkPoliciesRequest, options *armnetwork.SubnetsClientBeginPrepareNetworkPoliciesOptions) (resp azfake.PollerResponder[armnetwork.SubnetsClientPrepareNetworkPoliciesResponse], errResp azfake.ErrorResponder) // BeginUnprepareNetworkPolicies is the fake for method SubnetsClient.BeginUnprepareNetworkPolicies - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginUnprepareNetworkPolicies func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters armnetwork.UnprepareNetworkPoliciesRequest, options *armnetwork.SubnetsClientBeginUnprepareNetworkPoliciesOptions) (resp azfake.PollerResponder[armnetwork.SubnetsClientUnprepareNetworkPoliciesResponse], errResp azfake.ErrorResponder) } @@ -82,31 +79,50 @@ func (s *SubnetsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SubnetsClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "SubnetsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SubnetsClient.Get": - resp, err = s.dispatchGet(req) - case "SubnetsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SubnetsClient.BeginPrepareNetworkPolicies": - resp, err = s.dispatchBeginPrepareNetworkPolicies(req) - case "SubnetsClient.BeginUnprepareNetworkPolicies": - resp, err = s.dispatchBeginUnprepareNetworkPolicies(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SubnetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if subnetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = subnetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SubnetsClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SubnetsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SubnetsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SubnetsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SubnetsClient.BeginPrepareNetworkPolicies": + res.resp, res.err = s.dispatchBeginPrepareNetworkPolicies(req) + case "SubnetsClient.BeginUnprepareNetworkPolicies": + res.resp, res.err = s.dispatchBeginUnprepareNetworkPolicies(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SubnetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -340,9 +356,9 @@ func (s *SubnetsServerTransport) dispatchBeginPrepareNetworkPolicies(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPrepareNetworkPolicies) { s.beginPrepareNetworkPolicies.remove(req) @@ -392,9 +408,9 @@ func (s *SubnetsServerTransport) dispatchBeginUnprepareNetworkPolicies(req *http return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginUnprepareNetworkPolicies) { s.beginUnprepareNetworkPolicies.remove(req) @@ -402,3 +418,9 @@ func (s *SubnetsServerTransport) dispatchBeginUnprepareNetworkPolicies(req *http return resp, nil } + +// set this to conditionally intercept incoming requests to SubnetsServerTransport +var subnetsServerTransportInterceptor 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/subscriptionnetworkmanagerconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go index 6e26f42fbc2b..5f922ebce7cf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/subscriptionnetworkmanagerconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -67,27 +64,46 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) Do(req *http.Requ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SubscriptionNetworkManagerConnectionsClient.Delete": - resp, err = s.dispatchDelete(req) - case "SubscriptionNetworkManagerConnectionsClient.Get": - resp, err = s.dispatchGet(req) - case "SubscriptionNetworkManagerConnectionsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if subscriptionNetworkManagerConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = subscriptionNetworkManagerConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SubscriptionNetworkManagerConnectionsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SubscriptionNetworkManagerConnectionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SubscriptionNetworkManagerConnectionsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -240,3 +256,9 @@ func (s *SubscriptionNetworkManagerConnectionsServerTransport) dispatchNewListPa } return resp, nil } + +// set this to conditionally intercept incoming requests to SubscriptionNetworkManagerConnectionsServerTransport +var subscriptionNetworkManagerConnectionsServerTransportInterceptor 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/time_rfc3339.go b/sdk/resourcemanager/network/armnetwork/fake/time_rfc3339.go index 81f308b0d343..7691a451714b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/time_rfc3339.go +++ b/sdk/resourcemanager/network/armnetwork/fake/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } 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 diff --git a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go index 63546fc825d1..11c412a5c16b 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/usages_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/usages_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return u.dispatchToMethodFake(req, method) +} - switch method { - case "UsagesClient.NewListPager": - resp, err = u.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if usagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = usagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "UsagesClient.NewListPager": + res.resp, res.err = u.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to UsagesServerTransport +var usagesServerTransportInterceptor 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/verifierworkspaces_server.go b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go index d5fead734dd6..9d3f1f4aa6b5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/verifierworkspaces_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -31,7 +28,7 @@ type VerifierWorkspacesServer struct { Create func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body armnetwork.VerifierWorkspace, options *armnetwork.VerifierWorkspacesClientCreateOptions) (resp azfake.Responder[armnetwork.VerifierWorkspacesClientCreateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VerifierWorkspacesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *armnetwork.VerifierWorkspacesClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.VerifierWorkspacesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method VerifierWorkspacesClient.Get @@ -74,29 +71,48 @@ func (v *VerifierWorkspacesServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VerifierWorkspacesClient.Create": - resp, err = v.dispatchCreate(req) - case "VerifierWorkspacesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VerifierWorkspacesClient.Get": - resp, err = v.dispatchGet(req) - case "VerifierWorkspacesClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VerifierWorkspacesClient.Update": - resp, err = v.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VerifierWorkspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if verifierWorkspacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = verifierWorkspacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VerifierWorkspacesClient.Create": + res.resp, res.err = v.dispatchCreate(req) + case "VerifierWorkspacesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VerifierWorkspacesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VerifierWorkspacesClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VerifierWorkspacesClient.Update": + res.resp, res.err = v.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VerifierWorkspacesServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -177,9 +193,9 @@ func (v *VerifierWorkspacesServerTransport) dispatchBeginDelete(req *http.Reques return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -366,3 +382,9 @@ func (v *VerifierWorkspacesServerTransport) dispatchUpdate(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to VerifierWorkspacesServerTransport +var verifierWorkspacesServerTransportInterceptor 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/vipswap_server.go b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go index 8f9342430659..003e9af68b29 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vipswap_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -24,7 +21,7 @@ import ( // VipSwapServer is a fake server for instances of the armnetwork.VipSwapClient type. type VipSwapServer struct { // BeginCreate is the fake for method VipSwapClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreate func(ctx context.Context, groupName string, resourceName string, parameters armnetwork.SwapResource, options *armnetwork.VipSwapClientBeginCreateOptions) (resp azfake.PollerResponder[armnetwork.VipSwapClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method VipSwapClient.Get @@ -61,25 +58,44 @@ func (v *VipSwapServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VipSwapClient.BeginCreate": - resp, err = v.dispatchBeginCreate(req) - case "VipSwapClient.Get": - resp, err = v.dispatchGet(req) - case "VipSwapClient.List": - resp, err = v.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VipSwapServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vipSwapServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vipSwapServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VipSwapClient.BeginCreate": + res.resp, res.err = v.dispatchBeginCreate(req) + case "VipSwapClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VipSwapClient.List": + res.resp, res.err = v.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VipSwapServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -119,9 +135,9 @@ func (v *VipSwapServerTransport) dispatchBeginCreate(req *http.Request) (*http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreate) { v.beginCreate.remove(req) @@ -195,3 +211,9 @@ func (v *VipSwapServerTransport) dispatchList(req *http.Request) (*http.Response } return resp, nil } + +// set this to conditionally intercept incoming requests to VipSwapServerTransport +var vipSwapServerTransportInterceptor 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/virtualapplianceconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go index 6ec94ff2b2b6..0fda13d62314 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualApplianceConnectionsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualApplianceConnectionsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualApplianceConnectionsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualApplianceConnectionsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualApplianceConnectionsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualApplianceConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualApplianceConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualApplianceConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualApplianceConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualApplianceConnectionsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualApplianceConnectionsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualApplianceConnectionsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualApplianceConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualApplianceConnectionsServerTransport) dispatchNewListPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualApplianceConnectionsServerTransport +var virtualApplianceConnectionsServerTransportInterceptor 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/virtualappliances_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go index d271ab68538e..cb0f4ecaf792 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliances_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -37,6 +34,10 @@ type VirtualAppliancesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientGetOptions) (resp azfake.Responder[armnetwork.VirtualAppliancesClientGetResponse], errResp azfake.ErrorResponder) + // BeginGetBootDiagnosticLogs is the fake for method VirtualAppliancesClient.BeginGetBootDiagnosticLogs + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetBootDiagnosticLogs func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, request armnetwork.VirtualApplianceBootDiagnosticParameters, options *armnetwork.VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse], errResp azfake.ErrorResponder) + // NewListPager is the fake for method VirtualAppliancesClient.NewListPager // HTTP status codes to indicate success: http.StatusOK NewListPager func(options *armnetwork.VirtualAppliancesClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]) @@ -45,6 +46,10 @@ type VirtualAppliancesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armnetwork.VirtualAppliancesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]) + // BeginReimage is the fake for method VirtualAppliancesClient.BeginReimage + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginReimage func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientBeginReimageOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse], errResp azfake.ErrorResponder) + // BeginRestart is the fake for method VirtualAppliancesClient.BeginRestart // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRestart func(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *armnetwork.VirtualAppliancesClientBeginRestartOptions) (resp azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse], errResp azfake.ErrorResponder) @@ -62,8 +67,10 @@ func NewVirtualAppliancesServerTransport(srv *VirtualAppliancesServer) *VirtualA srv: srv, beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientDeleteResponse]](), + beginGetBootDiagnosticLogs: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse]](), newListPager: newTracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse]](), beginRestart: newTracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse]](), } } @@ -74,8 +81,10 @@ type VirtualAppliancesServerTransport struct { srv *VirtualAppliancesServer beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientDeleteResponse]] + beginGetBootDiagnosticLogs *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientGetBootDiagnosticLogsResponse]] newListPager *tracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armnetwork.VirtualAppliancesClientListByResourceGroupResponse]] + beginReimage *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientReimageResponse]] beginRestart *tracker[azfake.PollerResponder[armnetwork.VirtualAppliancesClientRestartResponse]] } @@ -87,33 +96,56 @@ func (v *VirtualAppliancesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualAppliancesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualAppliancesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualAppliancesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualAppliancesClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualAppliancesClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualAppliancesClient.BeginRestart": - resp, err = v.dispatchBeginRestart(req) - case "VirtualAppliancesClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualAppliancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if virtualAppliancesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualAppliancesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualAppliancesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualAppliancesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualAppliancesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualAppliancesClient.BeginGetBootDiagnosticLogs": + res.resp, res.err = v.dispatchBeginGetBootDiagnosticLogs(req) + case "VirtualAppliancesClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualAppliancesClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualAppliancesClient.BeginReimage": + res.resp, res.err = v.dispatchBeginReimage(req) + case "VirtualAppliancesClient.BeginRestart": + res.resp, res.err = v.dispatchBeginRestart(req) + case "VirtualAppliancesClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualAppliancesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -253,6 +285,54 @@ func (v *VirtualAppliancesServerTransport) dispatchGet(req *http.Request) (*http return resp, nil } +func (v *VirtualAppliancesServerTransport) dispatchBeginGetBootDiagnosticLogs(req *http.Request) (*http.Response, error) { + if v.srv.BeginGetBootDiagnosticLogs == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetBootDiagnosticLogs not implemented")} + } + beginGetBootDiagnosticLogs := v.beginGetBootDiagnosticLogs.get(req) + if beginGetBootDiagnosticLogs == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkVirtualAppliances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getBootDiagnosticLogs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.VirtualApplianceBootDiagnosticParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkVirtualApplianceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkVirtualApplianceName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginGetBootDiagnosticLogs(req.Context(), resourceGroupNameParam, networkVirtualApplianceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetBootDiagnosticLogs = &respr + v.beginGetBootDiagnosticLogs.add(req, beginGetBootDiagnosticLogs) + } + + resp, err := server.PollerResponderNext(beginGetBootDiagnosticLogs, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginGetBootDiagnosticLogs) { + v.beginGetBootDiagnosticLogs.remove(req) + } + + return resp, nil +} + func (v *VirtualAppliancesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} @@ -323,6 +403,60 @@ func (v *VirtualAppliancesServerTransport) dispatchNewListByResourceGroupPager(r return resp, nil } +func (v *VirtualAppliancesServerTransport) dispatchBeginReimage(req *http.Request) (*http.Response, error) { + if v.srv.BeginReimage == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} + } + beginReimage := v.beginReimage.get(req) + if beginReimage == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/networkVirtualAppliances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.VirtualApplianceInstanceIDs](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + networkVirtualApplianceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkVirtualApplianceName")]) + if err != nil { + return nil, err + } + var options *armnetwork.VirtualAppliancesClientBeginReimageOptions + if !reflect.ValueOf(body).IsZero() { + options = &armnetwork.VirtualAppliancesClientBeginReimageOptions{ + NetworkVirtualApplianceInstanceIDs: &body, + } + } + respr, errRespr := v.srv.BeginReimage(req.Context(), resourceGroupNameParam, networkVirtualApplianceNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReimage = &respr + v.beginReimage.add(req, beginReimage) + } + + resp, err := server.PollerResponderNext(beginReimage, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginReimage) { + v.beginReimage.remove(req) + } + + return resp, nil +} + func (v *VirtualAppliancesServerTransport) dispatchBeginRestart(req *http.Request) (*http.Response, error) { if v.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} @@ -413,3 +547,9 @@ func (v *VirtualAppliancesServerTransport) dispatchUpdateTags(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualAppliancesServerTransport +var virtualAppliancesServerTransportInterceptor 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/virtualappliancesites_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go index cb8c405a6fd9..4651a319bee4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualappliancesites_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualApplianceSitesServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualApplianceSitesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualApplianceSitesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualApplianceSitesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualApplianceSitesClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualApplianceSitesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualApplianceSitesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualApplianceSitesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualApplianceSitesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualApplianceSitesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualApplianceSitesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualApplianceSitesClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualApplianceSitesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualApplianceSitesServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualApplianceSitesServerTransport +var virtualApplianceSitesServerTransportInterceptor 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/virtualapplianceskus_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go index 15ec7ac21e56..297e5a4a2fcf 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualapplianceskus_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (v *VirtualApplianceSKUsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualApplianceSKUsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualApplianceSKUsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualApplianceSKUsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualApplianceSkUsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualApplianceSkUsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualApplianceSKUsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualApplianceSKUsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualApplianceSKUsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -138,3 +154,9 @@ func (v *VirtualApplianceSKUsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualApplianceSKUsServerTransport +var virtualApplianceSkUsServerTransportInterceptor 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/virtualhubbgpconnection_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go index 09abcfc39728..2df9b0851f70 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnection_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -63,25 +60,44 @@ func (v *VirtualHubBgpConnectionServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualHubBgpConnectionClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualHubBgpConnectionClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualHubBgpConnectionClient.Get": - resp, err = v.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualHubBgpConnectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualHubBgpConnectionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualHubBgpConnectionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualHubBgpConnectionClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualHubBgpConnectionClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualHubBgpConnectionClient.Get": + res.resp, res.err = v.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualHubBgpConnectionServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -220,3 +236,9 @@ func (v *VirtualHubBgpConnectionServerTransport) dispatchGet(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualHubBgpConnectionServerTransport +var virtualHubBgpConnectionServerTransportInterceptor 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/virtualhubbgpconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go index b1593dfc8e26..a5f08ff2de18 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubbgpconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -66,25 +63,44 @@ func (v *VirtualHubBgpConnectionsServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualHubBgpConnectionsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes": - resp, err = v.dispatchBeginListAdvertisedRoutes(req) - case "VirtualHubBgpConnectionsClient.BeginListLearnedRoutes": - resp, err = v.dispatchBeginListLearnedRoutes(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualHubBgpConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualHubBgpConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualHubBgpConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualHubBgpConnectionsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes": + res.resp, res.err = v.dispatchBeginListAdvertisedRoutes(req) + case "VirtualHubBgpConnectionsClient.BeginListLearnedRoutes": + res.resp, res.err = v.dispatchBeginListLearnedRoutes(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualHubBgpConnectionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -223,3 +239,9 @@ func (v *VirtualHubBgpConnectionsServerTransport) dispatchBeginListLearnedRoutes return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualHubBgpConnectionsServerTransport +var virtualHubBgpConnectionsServerTransportInterceptor 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/virtualhubipconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go index 9299fa6fb144..1dfa8e22b4c1 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubipconfiguration_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualHubIPConfigurationServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualHubIPConfigurationClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualHubIPConfigurationClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualHubIPConfigurationClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualHubIPConfigurationClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualHubIPConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualHubIPConfigurationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualHubIPConfigurationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualHubIPConfigurationClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualHubIPConfigurationClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualHubIPConfigurationClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualHubIPConfigurationClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualHubIPConfigurationServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualHubIPConfigurationServerTransport) dispatchNewListPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualHubIPConfigurationServerTransport +var virtualHubIPConfigurationServerTransportInterceptor 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/virtualhubroutetablev2s_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go index c9ee6cb3a576..7f383078bec2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubroutetablev2s_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualHubRouteTableV2SServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualHubRouteTableV2SClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualHubRouteTableV2SClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualHubRouteTableV2SClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualHubRouteTableV2SClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualHubRouteTableV2SServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualHubRouteTableV2SServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualHubRouteTableV2SServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualHubRouteTableV2SClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualHubRouteTableV2SClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualHubRouteTableV2SClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualHubRouteTableV2SClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualHubRouteTableV2SServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualHubRouteTableV2SServerTransport) dispatchNewListPager(req *http. } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualHubRouteTableV2SServerTransport +var virtualHubRouteTableV2SServerTransportInterceptor 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/virtualhubs_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go index b923f21a36f9..dd7d114b01b4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualhubs_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -99,37 +96,56 @@ func (v *VirtualHubsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualHubsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualHubsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualHubsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes": - resp, err = v.dispatchBeginGetEffectiveVirtualHubRoutes(req) - case "VirtualHubsClient.BeginGetInboundRoutes": - resp, err = v.dispatchBeginGetInboundRoutes(req) - case "VirtualHubsClient.BeginGetOutboundRoutes": - resp, err = v.dispatchBeginGetOutboundRoutes(req) - case "VirtualHubsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualHubsClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualHubsClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualHubsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if virtualHubsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualHubsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualHubsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualHubsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualHubsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes": + res.resp, res.err = v.dispatchBeginGetEffectiveVirtualHubRoutes(req) + case "VirtualHubsClient.BeginGetInboundRoutes": + res.resp, res.err = v.dispatchBeginGetInboundRoutes(req) + case "VirtualHubsClient.BeginGetOutboundRoutes": + res.resp, res.err = v.dispatchBeginGetOutboundRoutes(req) + case "VirtualHubsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualHubsClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualHubsClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualHubsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -513,3 +529,9 @@ func (v *VirtualHubsServerTransport) dispatchUpdateTags(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualHubsServerTransport +var virtualHubsServerTransportInterceptor 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/virtualnetworkgatewayconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go index d249ae64d822..2e98845ddbf6 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewayconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -50,7 +47,7 @@ type VirtualNetworkGatewayConnectionsServer struct { NewListPager func(resourceGroupName string, options *armnetwork.VirtualNetworkGatewayConnectionsClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualNetworkGatewayConnectionsClientListResponse]) // BeginResetConnection is the fake for method VirtualNetworkGatewayConnectionsClient.BeginResetConnection - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetConnection func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *armnetwork.VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewayConnectionsClientResetConnectionResponse], errResp azfake.ErrorResponder) // BeginResetSharedKey is the fake for method VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey @@ -117,43 +114,62 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkGatewayConnectionsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkGatewayConnectionsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas": - resp, err = v.dispatchBeginGetIkeSas(req) - case "VirtualNetworkGatewayConnectionsClient.GetSharedKey": - resp, err = v.dispatchGetSharedKey(req) - case "VirtualNetworkGatewayConnectionsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualNetworkGatewayConnectionsClient.BeginResetConnection": - resp, err = v.dispatchBeginResetConnection(req) - case "VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey": - resp, err = v.dispatchBeginResetSharedKey(req) - case "VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey": - resp, err = v.dispatchBeginSetSharedKey(req) - case "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture": - resp, err = v.dispatchBeginStartPacketCapture(req) - case "VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture": - resp, err = v.dispatchBeginStopPacketCapture(req) - case "VirtualNetworkGatewayConnectionsClient.BeginUpdateTags": - resp, err = v.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if virtualNetworkGatewayConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkGatewayConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkGatewayConnectionsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkGatewayConnectionsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas": + res.resp, res.err = v.dispatchBeginGetIkeSas(req) + case "VirtualNetworkGatewayConnectionsClient.GetSharedKey": + res.resp, res.err = v.dispatchGetSharedKey(req) + case "VirtualNetworkGatewayConnectionsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualNetworkGatewayConnectionsClient.BeginResetConnection": + res.resp, res.err = v.dispatchBeginResetConnection(req) + case "VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey": + res.resp, res.err = v.dispatchBeginResetSharedKey(req) + case "VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey": + res.resp, res.err = v.dispatchBeginSetSharedKey(req) + case "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture": + res.resp, res.err = v.dispatchBeginStartPacketCapture(req) + case "VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture": + res.resp, res.err = v.dispatchBeginStopPacketCapture(req) + case "VirtualNetworkGatewayConnectionsClient.BeginUpdateTags": + res.resp, res.err = v.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -428,9 +444,9 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginResetConn return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !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.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetConnection) { v.beginResetConnection.remove(req) @@ -684,3 +700,9 @@ func (v *VirtualNetworkGatewayConnectionsServerTransport) dispatchBeginUpdateTag return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkGatewayConnectionsServerTransport +var virtualNetworkGatewayConnectionsServerTransportInterceptor 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/virtualnetworkgatewaynatrules_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go index f6893c02b48e..4b6a06b89995 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgatewaynatrules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkGatewayNatRulesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkGatewayNatRulesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager": - resp, err = v.dispatchNewListByVirtualNetworkGatewayPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworkGatewayNatRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkGatewayNatRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkGatewayNatRulesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkGatewayNatRulesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkGatewayNatRulesClient.NewListByVirtualNetworkGatewayPager": + res.resp, res.err = v.dispatchNewListByVirtualNetworkGatewayPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualNetworkGatewayNatRulesServerTransport) dispatchNewListByVirtualN } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkGatewayNatRulesServerTransport +var virtualNetworkGatewayNatRulesServerTransportInterceptor 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/virtualnetworkgateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go index 11fbf9fb255b..df5bfde713f2 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkgateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -35,7 +32,7 @@ type VirtualNetworkGatewaysServer struct { BeginDelete func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDisconnectVirtualNetworkGatewayVPNConnections is the fake for method VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDisconnectVirtualNetworkGatewayVPNConnections func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request armnetwork.P2SVPNConnectionRequest, options *armnetwork.VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientDisconnectVirtualNetworkGatewayVPNConnectionsResponse], errResp azfake.ErrorResponder) // BeginGenerateVPNProfile is the fake for method VirtualNetworkGatewaysClient.BeginGenerateVPNProfile @@ -70,6 +67,14 @@ type VirtualNetworkGatewaysServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginGetLearnedRoutes func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse], errResp azfake.ErrorResponder) + // BeginGetResiliencyInformation is the fake for method VirtualNetworkGatewaysClient.BeginGetResiliencyInformation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetResiliencyInformation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse], errResp azfake.ErrorResponder) + + // BeginGetRoutesInformation is the fake for method VirtualNetworkGatewaysClient.BeginGetRoutesInformation + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginGetRoutesInformation func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse], errResp azfake.ErrorResponder) + // BeginGetVPNProfilePackageURL is the fake for method VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginGetVPNProfilePackageURL func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse], errResp azfake.ErrorResponder) @@ -82,6 +87,22 @@ type VirtualNetworkGatewaysServer struct { // HTTP status codes to indicate success: http.StatusOK BeginGetVpnclientIPSecParameters func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse], errResp azfake.ErrorResponder) + // BeginInvokeAbortMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeAbortMigration + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginInvokeAbortMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse], errResp azfake.ErrorResponder) + + // BeginInvokeCommitMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeCommitMigration + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginInvokeCommitMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse], errResp azfake.ErrorResponder) + + // BeginInvokeExecuteMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginInvokeExecuteMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse], errResp azfake.ErrorResponder) + + // BeginInvokePrepareMigration is the fake for method VirtualNetworkGatewaysClient.BeginInvokePrepareMigration + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginInvokePrepareMigration func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, migrationParams armnetwork.VirtualNetworkGatewayMigrationParameters, options *armnetwork.VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse], errResp azfake.ErrorResponder) + // NewListPager is the fake for method VirtualNetworkGatewaysClient.NewListPager // HTTP status codes to indicate success: http.StatusOK NewListPager func(resourceGroupName string, options *armnetwork.VirtualNetworkGatewaysClientListOptions) (resp azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse]) @@ -95,7 +116,7 @@ type VirtualNetworkGatewaysServer struct { BeginReset func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse], errResp azfake.ErrorResponder) // BeginResetVPNClientSharedKey is the fake for method VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetVPNClientSharedKey func(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *armnetwork.VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (resp azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetVPNClientSharedKeyResponse], errResp azfake.ErrorResponder) // BeginSetVpnclientIPSecParameters is the fake for method VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters @@ -147,9 +168,15 @@ func NewVirtualNetworkGatewaysServerTransport(srv *VirtualNetworkGatewaysServer) beginGetFailoverAllTestDetails: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse]](), beginGetFailoverSingleTestDetails: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse]](), beginGetLearnedRoutes: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse]](), + beginGetResiliencyInformation: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse]](), + beginGetRoutesInformation: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse]](), beginGetVPNProfilePackageURL: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]](), beginGetVpnclientConnectionHealth: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]](), beginGetVpnclientIPSecParameters: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]](), + beginInvokeAbortMigration: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]](), + beginInvokeCommitMigration: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]](), + beginInvokeExecuteMigration: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]](), + beginInvokePrepareMigration: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]](), newListPager: newTracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse]](), newListConnectionsPager: newTracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse]](), beginReset: newTracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse]](), @@ -177,9 +204,15 @@ type VirtualNetworkGatewaysServerTransport struct { beginGetFailoverAllTestDetails *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse]] beginGetFailoverSingleTestDetails *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse]] beginGetLearnedRoutes *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetLearnedRoutesResponse]] + beginGetResiliencyInformation *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetResiliencyInformationResponse]] + beginGetRoutesInformation *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetRoutesInformationResponse]] beginGetVPNProfilePackageURL *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse]] beginGetVpnclientConnectionHealth *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse]] beginGetVpnclientIPSecParameters *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse]] + beginInvokeAbortMigration *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]] + beginInvokeCommitMigration *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]] + beginInvokeExecuteMigration *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]] + beginInvokePrepareMigration *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]] newListPager *tracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListResponse]] newListConnectionsPager *tracker[azfake.PagerResponder[armnetwork.VirtualNetworkGatewaysClientListConnectionsResponse]] beginReset *tracker[azfake.PollerResponder[armnetwork.VirtualNetworkGatewaysClientResetResponse]] @@ -200,71 +233,102 @@ func (v *VirtualNetworkGatewaysServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualNetworkGatewaysClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkGatewaysClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections": - resp, err = v.dispatchBeginDisconnectVirtualNetworkGatewayVPNConnections(req) - case "VirtualNetworkGatewaysClient.BeginGenerateVPNProfile": - resp, err = v.dispatchBeginGenerateVPNProfile(req) - case "VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage": - resp, err = v.dispatchBeginGeneratevpnclientpackage(req) - case "VirtualNetworkGatewaysClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes": - resp, err = v.dispatchBeginGetAdvertisedRoutes(req) - case "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus": - resp, err = v.dispatchBeginGetBgpPeerStatus(req) - case "VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails": - resp, err = v.dispatchBeginGetFailoverAllTestDetails(req) - case "VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails": - resp, err = v.dispatchBeginGetFailoverSingleTestDetails(req) - case "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes": - resp, err = v.dispatchBeginGetLearnedRoutes(req) - case "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL": - resp, err = v.dispatchBeginGetVPNProfilePackageURL(req) - case "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth": - resp, err = v.dispatchBeginGetVpnclientConnectionHealth(req) - case "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters": - resp, err = v.dispatchBeginGetVpnclientIPSecParameters(req) - case "VirtualNetworkGatewaysClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualNetworkGatewaysClient.NewListConnectionsPager": - resp, err = v.dispatchNewListConnectionsPager(req) - case "VirtualNetworkGatewaysClient.BeginReset": - resp, err = v.dispatchBeginReset(req) - case "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey": - resp, err = v.dispatchBeginResetVPNClientSharedKey(req) - case "VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters": - resp, err = v.dispatchBeginSetVpnclientIPSecParameters(req) - case "VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation": - resp, err = v.dispatchBeginStartExpressRouteSiteFailoverSimulation(req) - case "VirtualNetworkGatewaysClient.BeginStartPacketCapture": - resp, err = v.dispatchBeginStartPacketCapture(req) - case "VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation": - resp, err = v.dispatchBeginStopExpressRouteSiteFailoverSimulation(req) - case "VirtualNetworkGatewaysClient.BeginStopPacketCapture": - resp, err = v.dispatchBeginStopPacketCapture(req) - case "VirtualNetworkGatewaysClient.SupportedVPNDevices": - resp, err = v.dispatchSupportedVPNDevices(req) - case "VirtualNetworkGatewaysClient.BeginUpdateTags": - resp, err = v.dispatchBeginUpdateTags(req) - case "VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript": - resp, err = v.dispatchVPNDeviceConfigurationScript(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualNetworkGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if virtualNetworkGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkGatewaysClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections": + res.resp, res.err = v.dispatchBeginDisconnectVirtualNetworkGatewayVPNConnections(req) + case "VirtualNetworkGatewaysClient.BeginGenerateVPNProfile": + res.resp, res.err = v.dispatchBeginGenerateVPNProfile(req) + case "VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage": + res.resp, res.err = v.dispatchBeginGeneratevpnclientpackage(req) + case "VirtualNetworkGatewaysClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes": + res.resp, res.err = v.dispatchBeginGetAdvertisedRoutes(req) + case "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus": + res.resp, res.err = v.dispatchBeginGetBgpPeerStatus(req) + case "VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails": + res.resp, res.err = v.dispatchBeginGetFailoverAllTestDetails(req) + case "VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails": + res.resp, res.err = v.dispatchBeginGetFailoverSingleTestDetails(req) + case "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes": + res.resp, res.err = v.dispatchBeginGetLearnedRoutes(req) + case "VirtualNetworkGatewaysClient.BeginGetResiliencyInformation": + res.resp, res.err = v.dispatchBeginGetResiliencyInformation(req) + case "VirtualNetworkGatewaysClient.BeginGetRoutesInformation": + res.resp, res.err = v.dispatchBeginGetRoutesInformation(req) + case "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL": + res.resp, res.err = v.dispatchBeginGetVPNProfilePackageURL(req) + case "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth": + res.resp, res.err = v.dispatchBeginGetVpnclientConnectionHealth(req) + case "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters": + res.resp, res.err = v.dispatchBeginGetVpnclientIPSecParameters(req) + case "VirtualNetworkGatewaysClient.BeginInvokeAbortMigration": + res.resp, res.err = v.dispatchBeginInvokeAbortMigration(req) + case "VirtualNetworkGatewaysClient.BeginInvokeCommitMigration": + res.resp, res.err = v.dispatchBeginInvokeCommitMigration(req) + case "VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration": + res.resp, res.err = v.dispatchBeginInvokeExecuteMigration(req) + case "VirtualNetworkGatewaysClient.BeginInvokePrepareMigration": + res.resp, res.err = v.dispatchBeginInvokePrepareMigration(req) + case "VirtualNetworkGatewaysClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualNetworkGatewaysClient.NewListConnectionsPager": + res.resp, res.err = v.dispatchNewListConnectionsPager(req) + case "VirtualNetworkGatewaysClient.BeginReset": + res.resp, res.err = v.dispatchBeginReset(req) + case "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey": + res.resp, res.err = v.dispatchBeginResetVPNClientSharedKey(req) + case "VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters": + res.resp, res.err = v.dispatchBeginSetVpnclientIPSecParameters(req) + case "VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation": + res.resp, res.err = v.dispatchBeginStartExpressRouteSiteFailoverSimulation(req) + case "VirtualNetworkGatewaysClient.BeginStartPacketCapture": + res.resp, res.err = v.dispatchBeginStartPacketCapture(req) + case "VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation": + res.resp, res.err = v.dispatchBeginStopExpressRouteSiteFailoverSimulation(req) + case "VirtualNetworkGatewaysClient.BeginStopPacketCapture": + res.resp, res.err = v.dispatchBeginStopPacketCapture(req) + case "VirtualNetworkGatewaysClient.SupportedVPNDevices": + res.resp, res.err = v.dispatchSupportedVPNDevices(req) + case "VirtualNetworkGatewaysClient.BeginUpdateTags": + res.resp, res.err = v.dispatchBeginUpdateTags(req) + case "VirtualNetworkGatewaysClient.VPNDeviceConfigurationScript": + res.resp, res.err = v.dispatchVPNDeviceConfigurationScript(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -396,9 +460,9 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginDisconnectVirtualNe return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDisconnectVirtualNetworkGatewayVPNConnections) { v.beginDisconnectVirtualNetworkGatewayVPNConnections.remove(req) @@ -795,6 +859,124 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetLearnedRoutes(re return resp, nil } +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetResiliencyInformation(req *http.Request) (*http.Response, error) { + if v.srv.BeginGetResiliencyInformation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetResiliencyInformation not implemented")} + } + beginGetResiliencyInformation := v.beginGetResiliencyInformation.get(req) + if beginGetResiliencyInformation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getResiliencyInformation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + 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) + if err != nil { + return nil, err + } + var options *armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions + if attemptRefreshParam != nil { + options = &armnetwork.VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions{ + AttemptRefresh: attemptRefreshParam, + } + } + respr, errRespr := v.srv.BeginGetResiliencyInformation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetResiliencyInformation = &respr + v.beginGetResiliencyInformation.add(req, beginGetResiliencyInformation) + } + + resp, err := server.PollerResponderNext(beginGetResiliencyInformation, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginGetResiliencyInformation) { + v.beginGetResiliencyInformation.remove(req) + } + + return resp, nil +} + +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetRoutesInformation(req *http.Request) (*http.Response, error) { + if v.srv.BeginGetRoutesInformation == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginGetRoutesInformation not implemented")} + } + beginGetRoutesInformation := v.beginGetRoutesInformation.get(req) + if beginGetRoutesInformation == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/getRoutesInformation` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + 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) + if err != nil { + return nil, err + } + var options *armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions + if attemptRefreshParam != nil { + options = &armnetwork.VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions{ + AttemptRefresh: attemptRefreshParam, + } + } + respr, errRespr := v.srv.BeginGetRoutesInformation(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginGetRoutesInformation = &respr + v.beginGetRoutesInformation.add(req, beginGetRoutesInformation) + } + + resp, err := server.PollerResponderNext(beginGetRoutesInformation, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginGetRoutesInformation) { + v.beginGetRoutesInformation.remove(req) + } + + return resp, nil +} + func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVPNProfilePackageURL(req *http.Request) (*http.Response, error) { if v.srv.BeginGetVPNProfilePackageURL == nil { return nil, &nonRetriableError{errors.New("fake for method BeginGetVPNProfilePackageURL not implemented")} @@ -927,6 +1109,186 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginGetVpnclientIPSecPa return resp, nil } +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeAbortMigration(req *http.Request) (*http.Response, error) { + if v.srv.BeginInvokeAbortMigration == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginInvokeAbortMigration not implemented")} + } + beginInvokeAbortMigration := v.beginInvokeAbortMigration.get(req) + if beginInvokeAbortMigration == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/abortMigration` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginInvokeAbortMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginInvokeAbortMigration = &respr + v.beginInvokeAbortMigration.add(req, beginInvokeAbortMigration) + } + + resp, err := server.PollerResponderNext(beginInvokeAbortMigration, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginInvokeAbortMigration) { + v.beginInvokeAbortMigration.remove(req) + } + + return resp, nil +} + +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeCommitMigration(req *http.Request) (*http.Response, error) { + if v.srv.BeginInvokeCommitMigration == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginInvokeCommitMigration not implemented")} + } + beginInvokeCommitMigration := v.beginInvokeCommitMigration.get(req) + if beginInvokeCommitMigration == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/commitMigration` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginInvokeCommitMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginInvokeCommitMigration = &respr + v.beginInvokeCommitMigration.add(req, beginInvokeCommitMigration) + } + + resp, err := server.PollerResponderNext(beginInvokeCommitMigration, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginInvokeCommitMigration) { + v.beginInvokeCommitMigration.remove(req) + } + + return resp, nil +} + +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokeExecuteMigration(req *http.Request) (*http.Response, error) { + if v.srv.BeginInvokeExecuteMigration == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginInvokeExecuteMigration not implemented")} + } + beginInvokeExecuteMigration := v.beginInvokeExecuteMigration.get(req) + if beginInvokeExecuteMigration == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/executeMigration` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginInvokeExecuteMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginInvokeExecuteMigration = &respr + v.beginInvokeExecuteMigration.add(req, beginInvokeExecuteMigration) + } + + resp, err := server.PollerResponderNext(beginInvokeExecuteMigration, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginInvokeExecuteMigration) { + v.beginInvokeExecuteMigration.remove(req) + } + + return resp, nil +} + +func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginInvokePrepareMigration(req *http.Request) (*http.Response, error) { + if v.srv.BeginInvokePrepareMigration == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginInvokePrepareMigration not implemented")} + } + beginInvokePrepareMigration := v.beginInvokePrepareMigration.get(req) + if beginInvokePrepareMigration == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Network/virtualNetworkGateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/prepareMigration` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armnetwork.VirtualNetworkGatewayMigrationParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + virtualNetworkGatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("virtualNetworkGatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := v.srv.BeginInvokePrepareMigration(req.Context(), resourceGroupNameParam, virtualNetworkGatewayNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginInvokePrepareMigration = &respr + v.beginInvokePrepareMigration.add(req, beginInvokePrepareMigration) + } + + resp, err := server.PollerResponderNext(beginInvokePrepareMigration, req) + if err != nil { + return nil, err + } + + if !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)} + } + if !server.PollerResponderMore(beginInvokePrepareMigration) { + v.beginInvokePrepareMigration.remove(req) + } + + return resp, nil +} + func (v *VirtualNetworkGatewaysServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} @@ -1094,9 +1456,9 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchBeginResetVPNClientShare return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetVPNClientSharedKey) { v.beginResetVPNClientSharedKey.remove(req) @@ -1469,3 +1831,9 @@ func (v *VirtualNetworkGatewaysServerTransport) dispatchVPNDeviceConfigurationSc } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkGatewaysServerTransport +var virtualNetworkGatewaysServerTransportInterceptor 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/virtualnetworkpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go index 4839332861d3..935f730357c5 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworkpeerings_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualNetworkPeeringsServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworkPeeringsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkPeeringsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkPeeringsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkPeeringsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworkPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworkPeeringsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkPeeringsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkPeeringsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkPeeringsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkPeeringsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkPeeringsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkPeeringsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -282,3 +298,9 @@ func (v *VirtualNetworkPeeringsServerTransport) dispatchNewListPager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkPeeringsServerTransport +var virtualNetworkPeeringsServerTransportInterceptor 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/virtualnetworks_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go index 6b61b3baed96..bf9d9af8dd47 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -97,37 +94,56 @@ func (v *VirtualNetworksServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualNetworksClient.CheckIPAddressAvailability": - resp, err = v.dispatchCheckIPAddressAvailability(req) - case "VirtualNetworksClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworksClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworksClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworksClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualNetworksClient.NewListAllPager": - resp, err = v.dispatchNewListAllPager(req) - case "VirtualNetworksClient.BeginListDdosProtectionStatus": - resp, err = v.dispatchBeginListDdosProtectionStatus(req) - case "VirtualNetworksClient.NewListUsagePager": - resp, err = v.dispatchNewListUsagePager(req) - case "VirtualNetworksClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualNetworksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if virtualNetworksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworksClient.CheckIPAddressAvailability": + res.resp, res.err = v.dispatchCheckIPAddressAvailability(req) + case "VirtualNetworksClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworksClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworksClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworksClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualNetworksClient.NewListAllPager": + res.resp, res.err = v.dispatchNewListAllPager(req) + case "VirtualNetworksClient.BeginListDdosProtectionStatus": + res.resp, res.err = v.dispatchBeginListDdosProtectionStatus(req) + case "VirtualNetworksClient.NewListUsagePager": + res.resp, res.err = v.dispatchNewListUsagePager(req) + case "VirtualNetworksClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworksServerTransport) dispatchCheckIPAddressAvailability(req *http.Request) (*http.Response, error) { @@ -523,3 +539,9 @@ func (v *VirtualNetworksServerTransport) dispatchUpdateTags(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworksServerTransport +var virtualNetworksServerTransportInterceptor 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/virtualnetworktaps_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go index f3ac25fdc99a..0990916b6d93 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualnetworktaps_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (v *VirtualNetworkTapsServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworkTapsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworkTapsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworkTapsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworkTapsClient.NewListAllPager": - resp, err = v.dispatchNewListAllPager(req) - case "VirtualNetworkTapsClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualNetworkTapsClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworkTapsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworkTapsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworkTapsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworkTapsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworkTapsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworkTapsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworkTapsClient.NewListAllPager": + res.resp, res.err = v.dispatchNewListAllPager(req) + case "VirtualNetworkTapsClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualNetworkTapsClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworkTapsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (v *VirtualNetworkTapsServerTransport) dispatchUpdateTags(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworkTapsServerTransport +var virtualNetworkTapsServerTransportInterceptor 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/virtualrouterpeerings_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go index c831280fc908..ecff0ad6adfb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouterpeerings_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (v *VirtualRouterPeeringsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualRouterPeeringsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualRouterPeeringsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualRouterPeeringsClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualRouterPeeringsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualRouterPeeringsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualRouterPeeringsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualRouterPeeringsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualRouterPeeringsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualRouterPeeringsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualRouterPeeringsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualRouterPeeringsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualRouterPeeringsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (v *VirtualRouterPeeringsServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualRouterPeeringsServerTransport +var virtualRouterPeeringsServerTransportInterceptor 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/virtualrouters_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go index 373c3a33c2f6..317c1740c230 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualrouters_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (v *VirtualRoutersServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualRoutersClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualRoutersClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualRoutersClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualRoutersClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualRoutersClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualRoutersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualRoutersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualRoutersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualRoutersClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualRoutersClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualRoutersClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualRoutersClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualRoutersClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualRoutersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -307,3 +323,9 @@ func (v *VirtualRoutersServerTransport) dispatchNewListByResourceGroupPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualRoutersServerTransport +var virtualRoutersServerTransportInterceptor 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/virtualwans_server.go b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go index 6a5e5426e3c3..63d423d9b0d4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/virtualwans_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (v *VirtualWansServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualWansClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualWansClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualWansClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualWansClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualWansClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualWansClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualWansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualWansServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualWansServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualWansClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualWansClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualWansClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualWansClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualWansClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualWansClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualWansServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (v *VirtualWansServerTransport) dispatchUpdateTags(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualWansServerTransport +var virtualWansServerTransportInterceptor 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/vpnconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go index 0f8a330483c9..549a4314b47a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -83,31 +80,50 @@ func (v *VPNConnectionsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNConnectionsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VPNConnectionsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VPNConnectionsClient.Get": - resp, err = v.dispatchGet(req) - case "VPNConnectionsClient.NewListByVPNGatewayPager": - resp, err = v.dispatchNewListByVPNGatewayPager(req) - case "VPNConnectionsClient.BeginStartPacketCapture": - resp, err = v.dispatchBeginStartPacketCapture(req) - case "VPNConnectionsClient.BeginStopPacketCapture": - resp, err = v.dispatchBeginStopPacketCapture(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNConnectionsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VPNConnectionsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VPNConnectionsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VPNConnectionsClient.NewListByVPNGatewayPager": + res.resp, res.err = v.dispatchNewListByVPNGatewayPager(req) + case "VPNConnectionsClient.BeginStartPacketCapture": + res.resp, res.err = v.dispatchBeginStartPacketCapture(req) + case "VPNConnectionsClient.BeginStopPacketCapture": + res.resp, res.err = v.dispatchBeginStopPacketCapture(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -403,3 +419,9 @@ func (v *VPNConnectionsServerTransport) dispatchBeginStopPacketCapture(req *http return resp, nil } + +// set this to conditionally intercept incoming requests to VPNConnectionsServerTransport +var vpnConnectionsServerTransportInterceptor 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/vpngateways_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go index cd72034e622f..3ababb622431 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpngateways_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "reflect" @@ -101,37 +98,56 @@ func (v *VPNGatewaysServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VPNGatewaysClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VPNGatewaysClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VPNGatewaysClient.Get": - resp, err = v.dispatchGet(req) - case "VPNGatewaysClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VPNGatewaysClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VPNGatewaysClient.BeginReset": - resp, err = v.dispatchBeginReset(req) - case "VPNGatewaysClient.BeginStartPacketCapture": - resp, err = v.dispatchBeginStartPacketCapture(req) - case "VPNGatewaysClient.BeginStopPacketCapture": - resp, err = v.dispatchBeginStopPacketCapture(req) - case "VPNGatewaysClient.BeginUpdateTags": - resp, err = v.dispatchBeginUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VPNGatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if vpnGatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnGatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNGatewaysClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VPNGatewaysClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VPNGatewaysClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VPNGatewaysClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VPNGatewaysClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VPNGatewaysClient.BeginReset": + res.resp, res.err = v.dispatchBeginReset(req) + case "VPNGatewaysClient.BeginStartPacketCapture": + res.resp, res.err = v.dispatchBeginStartPacketCapture(req) + case "VPNGatewaysClient.BeginStopPacketCapture": + res.resp, res.err = v.dispatchBeginStopPacketCapture(req) + case "VPNGatewaysClient.BeginUpdateTags": + res.resp, res.err = v.dispatchBeginUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNGatewaysServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -540,3 +556,9 @@ func (v *VPNGatewaysServerTransport) dispatchBeginUpdateTags(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to VPNGatewaysServerTransport +var vpnGatewaysServerTransportInterceptor 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/vpnlinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go index 414cf1618a7f..ae24846ad383 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnlinkconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -45,7 +42,7 @@ type VPNLinkConnectionsServer struct { ListDefaultSharedKey func(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *armnetwork.VPNLinkConnectionsClientListDefaultSharedKeyOptions) (resp azfake.Responder[armnetwork.VPNLinkConnectionsClientListDefaultSharedKeyResponse], errResp azfake.ErrorResponder) // BeginResetConnection is the fake for method VPNLinkConnectionsClient.BeginResetConnection - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginResetConnection func(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *armnetwork.VPNLinkConnectionsClientBeginResetConnectionOptions) (resp azfake.PollerResponder[armnetwork.VPNLinkConnectionsClientResetConnectionResponse], errResp azfake.ErrorResponder) // BeginSetOrInitDefaultSharedKey is the fake for method VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey @@ -86,33 +83,52 @@ func (v *VPNLinkConnectionsServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VPNLinkConnectionsClient.NewGetAllSharedKeysPager": - resp, err = v.dispatchNewGetAllSharedKeysPager(req) - case "VPNLinkConnectionsClient.GetDefaultSharedKey": - resp, err = v.dispatchGetDefaultSharedKey(req) - case "VPNLinkConnectionsClient.BeginGetIkeSas": - resp, err = v.dispatchBeginGetIkeSas(req) - case "VPNLinkConnectionsClient.NewListByVPNConnectionPager": - resp, err = v.dispatchNewListByVPNConnectionPager(req) - case "VPNLinkConnectionsClient.ListDefaultSharedKey": - resp, err = v.dispatchListDefaultSharedKey(req) - case "VPNLinkConnectionsClient.BeginResetConnection": - resp, err = v.dispatchBeginResetConnection(req) - case "VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey": - resp, err = v.dispatchBeginSetOrInitDefaultSharedKey(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VPNLinkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if vpnLinkConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnLinkConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNLinkConnectionsClient.NewGetAllSharedKeysPager": + res.resp, res.err = v.dispatchNewGetAllSharedKeysPager(req) + case "VPNLinkConnectionsClient.GetDefaultSharedKey": + res.resp, res.err = v.dispatchGetDefaultSharedKey(req) + case "VPNLinkConnectionsClient.BeginGetIkeSas": + res.resp, res.err = v.dispatchBeginGetIkeSas(req) + case "VPNLinkConnectionsClient.NewListByVPNConnectionPager": + res.resp, res.err = v.dispatchNewListByVPNConnectionPager(req) + case "VPNLinkConnectionsClient.ListDefaultSharedKey": + res.resp, res.err = v.dispatchListDefaultSharedKey(req) + case "VPNLinkConnectionsClient.BeginResetConnection": + res.resp, res.err = v.dispatchBeginResetConnection(req) + case "VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey": + res.resp, res.err = v.dispatchBeginSetOrInitDefaultSharedKey(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNLinkConnectionsServerTransport) dispatchNewGetAllSharedKeysPager(req *http.Request) (*http.Response, error) { @@ -384,9 +400,9 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginResetConnection(req *ht return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !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.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginResetConnection) { v.beginResetConnection.remove(req) @@ -450,3 +466,9 @@ func (v *VPNLinkConnectionsServerTransport) dispatchBeginSetOrInitDefaultSharedK return resp, nil } + +// set this to conditionally intercept incoming requests to VPNLinkConnectionsServerTransport +var vpnLinkConnectionsServerTransportInterceptor 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/vpnserverconfigurations_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go index fcdb23b40778..a2a7b83ce618 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (v *VPNServerConfigurationsServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNServerConfigurationsClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VPNServerConfigurationsClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VPNServerConfigurationsClient.Get": - resp, err = v.dispatchGet(req) - case "VPNServerConfigurationsClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VPNServerConfigurationsClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VPNServerConfigurationsClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNServerConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnServerConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnServerConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNServerConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VPNServerConfigurationsClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VPNServerConfigurationsClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VPNServerConfigurationsClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VPNServerConfigurationsClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VPNServerConfigurationsClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNServerConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (v *VPNServerConfigurationsServerTransport) dispatchUpdateTags(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to VPNServerConfigurationsServerTransport +var vpnServerConfigurationsServerTransportInterceptor 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/vpnserverconfigurationsassociatedwithvirtualwan_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go index 16691263aba6..6335cf3055ea 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnserverconfigurationsassociatedwithvirtualwan_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -53,21 +50,40 @@ func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) Do(req return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList": - resp, err = v.dispatchBeginList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnServerConfigurationsAssociatedWithVirtualWanServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnServerConfigurationsAssociatedWithVirtualWanServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList": + res.resp, res.err = v.dispatchBeginList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatchBeginList(req *http.Request) (*http.Response, error) { @@ -113,3 +129,9 @@ func (v *VPNServerConfigurationsAssociatedWithVirtualWanServerTransport) dispatc return resp, nil } + +// set this to conditionally intercept incoming requests to VPNServerConfigurationsAssociatedWithVirtualWanServerTransport +var vpnServerConfigurationsAssociatedWithVirtualWanServerTransportInterceptor 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/vpnsitelinkconnections_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go index 1b3675c91d1b..b57014b89e16 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinkconnections_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -49,21 +46,40 @@ func (v *VPNSiteLinkConnectionsServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNSiteLinkConnectionsClient.Get": - resp, err = v.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNSiteLinkConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnSiteLinkConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnSiteLinkConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNSiteLinkConnectionsClient.Get": + res.resp, res.err = v.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNSiteLinkConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (v *VPNSiteLinkConnectionsServerTransport) dispatchGet(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to VPNSiteLinkConnectionsServerTransport +var vpnSiteLinkConnectionsServerTransportInterceptor 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/vpnsitelinks_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go index 9aa7d6c05509..5199f9d98f8a 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitelinks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (v *VPNSiteLinksServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNSiteLinksClient.Get": - resp, err = v.dispatchGet(req) - case "VPNSiteLinksClient.NewListByVPNSitePager": - resp, err = v.dispatchNewListByVPNSitePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNSiteLinksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnSiteLinksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnSiteLinksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNSiteLinksClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VPNSiteLinksClient.NewListByVPNSitePager": + res.resp, res.err = v.dispatchNewListByVPNSitePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNSiteLinksServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -154,3 +170,9 @@ func (v *VPNSiteLinksServerTransport) dispatchNewListByVPNSitePager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to VPNSiteLinksServerTransport +var vpnSiteLinksServerTransportInterceptor 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/vpnsites_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go index 0c207fa83084..25515c804812 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsites_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -80,31 +77,50 @@ func (v *VPNSitesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNSitesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VPNSitesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VPNSitesClient.Get": - resp, err = v.dispatchGet(req) - case "VPNSitesClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VPNSitesClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VPNSitesClient.UpdateTags": - resp, err = v.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNSitesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnSitesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnSitesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNSitesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VPNSitesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VPNSitesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VPNSitesClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VPNSitesClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VPNSitesClient.UpdateTags": + res.resp, res.err = v.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNSitesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -338,3 +354,9 @@ func (v *VPNSitesServerTransport) dispatchUpdateTags(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to VPNSitesServerTransport +var vpnSitesServerTransportInterceptor 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/vpnsitesconfiguration_server.go b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go index 8459d19b216a..af63b5331836 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/vpnsitesconfiguration_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -24,7 +21,7 @@ import ( // VPNSitesConfigurationServer is a fake server for instances of the armnetwork.VPNSitesConfigurationClient type. type VPNSitesConfigurationServer struct { // BeginDownload is the fake for method VPNSitesConfigurationClient.BeginDownload - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDownload func(ctx context.Context, resourceGroupName string, virtualWANName string, request armnetwork.GetVPNSitesConfigurationRequest, options *armnetwork.VPNSitesConfigurationClientBeginDownloadOptions) (resp azfake.PollerResponder[armnetwork.VPNSitesConfigurationClientDownloadResponse], errResp azfake.ErrorResponder) } @@ -53,21 +50,40 @@ func (v *VPNSitesConfigurationServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VPNSitesConfigurationClient.BeginDownload": - resp, err = v.dispatchBeginDownload(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VPNSitesConfigurationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vpnSitesConfigurationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vpnSitesConfigurationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VPNSitesConfigurationClient.BeginDownload": + res.resp, res.err = v.dispatchBeginDownload(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VPNSitesConfigurationServerTransport) dispatchBeginDownload(req *http.Request) (*http.Response, error) { @@ -107,9 +123,9 @@ func (v *VPNSitesConfigurationServerTransport) dispatchBeginDownload(req *http.R return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !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", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDownload) { v.beginDownload.remove(req) @@ -117,3 +133,9 @@ func (v *VPNSitesConfigurationServerTransport) dispatchBeginDownload(req *http.R return resp, nil } + +// set this to conditionally intercept incoming requests to VPNSitesConfigurationServerTransport +var vpnSitesConfigurationServerTransportInterceptor 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/watchers_server.go b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go index 56f578a77953..2aee3a76c6cb 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/watchers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -32,7 +29,7 @@ type WatchersServer struct { CreateOrUpdate func(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters armnetwork.Watcher, options *armnetwork.WatchersClientCreateOrUpdateOptions) (resp azfake.Responder[armnetwork.WatchersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method WatchersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, networkWatcherName string, options *armnetwork.WatchersClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetwork.WatchersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method WatchersClient.Get @@ -147,55 +144,74 @@ func (w *WatchersServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "WatchersClient.BeginCheckConnectivity": - resp, err = w.dispatchBeginCheckConnectivity(req) - case "WatchersClient.CreateOrUpdate": - resp, err = w.dispatchCreateOrUpdate(req) - case "WatchersClient.BeginDelete": - resp, err = w.dispatchBeginDelete(req) - case "WatchersClient.Get": - resp, err = w.dispatchGet(req) - case "WatchersClient.BeginGetAzureReachabilityReport": - resp, err = w.dispatchBeginGetAzureReachabilityReport(req) - case "WatchersClient.BeginGetFlowLogStatus": - resp, err = w.dispatchBeginGetFlowLogStatus(req) - case "WatchersClient.BeginGetNetworkConfigurationDiagnostic": - resp, err = w.dispatchBeginGetNetworkConfigurationDiagnostic(req) - case "WatchersClient.BeginGetNextHop": - resp, err = w.dispatchBeginGetNextHop(req) - case "WatchersClient.GetTopology": - resp, err = w.dispatchGetTopology(req) - case "WatchersClient.BeginGetTroubleshooting": - resp, err = w.dispatchBeginGetTroubleshooting(req) - case "WatchersClient.BeginGetTroubleshootingResult": - resp, err = w.dispatchBeginGetTroubleshootingResult(req) - case "WatchersClient.BeginGetVMSecurityRules": - resp, err = w.dispatchBeginGetVMSecurityRules(req) - case "WatchersClient.NewListPager": - resp, err = w.dispatchNewListPager(req) - case "WatchersClient.NewListAllPager": - resp, err = w.dispatchNewListAllPager(req) - case "WatchersClient.BeginListAvailableProviders": - resp, err = w.dispatchBeginListAvailableProviders(req) - case "WatchersClient.BeginSetFlowLogConfiguration": - resp, err = w.dispatchBeginSetFlowLogConfiguration(req) - case "WatchersClient.UpdateTags": - resp, err = w.dispatchUpdateTags(req) - case "WatchersClient.BeginVerifyIPFlow": - resp, err = w.dispatchBeginVerifyIPFlow(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return w.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (w *WatchersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if watchersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = watchersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WatchersClient.BeginCheckConnectivity": + res.resp, res.err = w.dispatchBeginCheckConnectivity(req) + case "WatchersClient.CreateOrUpdate": + res.resp, res.err = w.dispatchCreateOrUpdate(req) + case "WatchersClient.BeginDelete": + res.resp, res.err = w.dispatchBeginDelete(req) + case "WatchersClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WatchersClient.BeginGetAzureReachabilityReport": + res.resp, res.err = w.dispatchBeginGetAzureReachabilityReport(req) + case "WatchersClient.BeginGetFlowLogStatus": + res.resp, res.err = w.dispatchBeginGetFlowLogStatus(req) + case "WatchersClient.BeginGetNetworkConfigurationDiagnostic": + res.resp, res.err = w.dispatchBeginGetNetworkConfigurationDiagnostic(req) + case "WatchersClient.BeginGetNextHop": + res.resp, res.err = w.dispatchBeginGetNextHop(req) + case "WatchersClient.GetTopology": + res.resp, res.err = w.dispatchGetTopology(req) + case "WatchersClient.BeginGetTroubleshooting": + res.resp, res.err = w.dispatchBeginGetTroubleshooting(req) + case "WatchersClient.BeginGetTroubleshootingResult": + res.resp, res.err = w.dispatchBeginGetTroubleshootingResult(req) + case "WatchersClient.BeginGetVMSecurityRules": + res.resp, res.err = w.dispatchBeginGetVMSecurityRules(req) + case "WatchersClient.NewListPager": + res.resp, res.err = w.dispatchNewListPager(req) + case "WatchersClient.NewListAllPager": + res.resp, res.err = w.dispatchNewListAllPager(req) + case "WatchersClient.BeginListAvailableProviders": + res.resp, res.err = w.dispatchBeginListAvailableProviders(req) + case "WatchersClient.BeginSetFlowLogConfiguration": + res.resp, res.err = w.dispatchBeginSetFlowLogConfiguration(req) + case "WatchersClient.UpdateTags": + res.resp, res.err = w.dispatchUpdateTags(req) + case "WatchersClient.BeginVerifyIPFlow": + res.resp, res.err = w.dispatchBeginVerifyIPFlow(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (w *WatchersServerTransport) dispatchBeginCheckConnectivity(req *http.Request) (*http.Response, error) { @@ -316,9 +332,9 @@ func (w *WatchersServerTransport) dispatchBeginDelete(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !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.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { w.beginDelete.remove(req) @@ -977,3 +993,9 @@ func (w *WatchersServerTransport) dispatchBeginVerifyIPFlow(req *http.Request) ( return resp, nil } + +// set this to conditionally intercept incoming requests to WatchersServerTransport +var watchersServerTransportInterceptor 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/webapplicationfirewallpolicies_server.go b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go index a0e4344194dc..65856e509528 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webapplicationfirewallpolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -74,29 +71,48 @@ func (w *WebApplicationFirewallPoliciesServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WebApplicationFirewallPoliciesClient.CreateOrUpdate": - resp, err = w.dispatchCreateOrUpdate(req) - case "WebApplicationFirewallPoliciesClient.BeginDelete": - resp, err = w.dispatchBeginDelete(req) - case "WebApplicationFirewallPoliciesClient.Get": - resp, err = w.dispatchGet(req) - case "WebApplicationFirewallPoliciesClient.NewListPager": - resp, err = w.dispatchNewListPager(req) - case "WebApplicationFirewallPoliciesClient.NewListAllPager": - resp, err = w.dispatchNewListAllPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WebApplicationFirewallPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if webApplicationFirewallPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = webApplicationFirewallPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WebApplicationFirewallPoliciesClient.CreateOrUpdate": + res.resp, res.err = w.dispatchCreateOrUpdate(req) + case "WebApplicationFirewallPoliciesClient.BeginDelete": + res.resp, res.err = w.dispatchBeginDelete(req) + case "WebApplicationFirewallPoliciesClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WebApplicationFirewallPoliciesClient.NewListPager": + res.resp, res.err = w.dispatchNewListPager(req) + case "WebApplicationFirewallPoliciesClient.NewListAllPager": + res.resp, res.err = w.dispatchNewListAllPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WebApplicationFirewallPoliciesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -282,3 +298,9 @@ func (w *WebApplicationFirewallPoliciesServerTransport) dispatchNewListAllPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to WebApplicationFirewallPoliciesServerTransport +var webApplicationFirewallPoliciesServerTransportInterceptor 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/webcategories_server.go b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go index 469be222aa40..cd56f8f2b9a4 100644 --- a/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go +++ b/sdk/resourcemanager/network/armnetwork/fake/webcategories_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ 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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (w *WebCategoriesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WebCategoriesClient.Get": - resp, err = w.dispatchGet(req) - case "WebCategoriesClient.NewListBySubscriptionPager": - resp, err = w.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WebCategoriesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if webCategoriesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = webCategoriesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WebCategoriesClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WebCategoriesClient.NewListBySubscriptionPager": + res.resp, res.err = w.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WebCategoriesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -150,3 +166,9 @@ func (w *WebCategoriesServerTransport) dispatchNewListBySubscriptionPager(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to WebCategoriesServerTransport +var webCategoriesServerTransportInterceptor 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/firewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go index f36b3f47cfbc..cc417dfe9e05 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to the create or update Firewall Policy operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *FirewallPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *FirewallPoliciesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FirewallPoliciesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *FirewallPoliciesClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *FirewallPoliciesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPoliciesClientGetOptions contains the optional parameters for the FirewallPoliciesClient.Get method. @@ -254,7 +251,7 @@ func (client *FirewallPoliciesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *FirewallPoliciesClient) getHandleResponse(resp *http.Response) (Fi // NewListPager - Lists all Firewall Policies in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - FirewallPoliciesClientListOptions contains the optional parameters for the FirewallPoliciesClient.NewListPager // method. @@ -299,7 +296,7 @@ func (client *FirewallPoliciesClient) NewListPager(resourceGroupName string, opt } // listCreateRequest creates the List request. -func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *FirewallPoliciesClientListOptions) (*policy.Request, error) { +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") @@ -314,7 +311,7 @@ func (client *FirewallPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *FirewallPoliciesClient) listHandleResponse(resp *http.Response) (F // NewListAllPager - Gets all the Firewall Policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - FirewallPoliciesClientListAllOptions contains the optional parameters for the FirewallPoliciesClient.NewListAllPager // method. func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesClientListAllOptions) *runtime.Pager[FirewallPoliciesClientListAllResponse] { @@ -358,7 +355,7 @@ func (client *FirewallPoliciesClient) NewListAllPager(options *FirewallPoliciesC } // listAllCreateRequest creates the ListAll request. -func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *FirewallPoliciesClientListAllOptions) (*policy.Request, error) { +func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, _ *FirewallPoliciesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *FirewallPoliciesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to update Azure Firewall Policy tags. @@ -416,7 +413,7 @@ 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, options *FirewallPoliciesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -435,7 +432,7 @@ func (client *FirewallPoliciesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go deleted file mode 100644 index 025eaefd2fbb..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicies_client_example_test.go +++ /dev/null @@ -1,601 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - 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), - Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - }, - 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"), - }, - }, - }, - }, nil) - if 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.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), - // Profile: to.Ptr(armnetwork.FirewallPolicyIntrusionDetectionProfileType("Balanced")), - // }, - // 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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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")}, - // }, - // 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"), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPoliciesClient().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.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")}, - // }, - // 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"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPoliciesClient().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.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")}, - // }, - // 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"), - // }}, - // SKU: &armnetwork.FirewallPolicySKU{ - // Tier: to.Ptr(armnetwork.FirewallPolicySKUTierStandard), - // }, - // Snat: &armnetwork.FirewallPolicySNAT{ - // PrivateRanges: []*string{ - // to.Ptr("IANAPrivateRanges")}, - // }, - // SQL: &armnetwork.FirewallPolicySQL{ - // AllowSQLRedirect: to.Ptr(true), - // }, - // ThreatIntelMode: to.Ptr(armnetwork.AzureFirewallThreatIntelModeAlert), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go index 81ae4ff38422..4fef9fb3def1 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicy_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go index 8d83c781a7a6..65e46fa7ab7b 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDeploymentsClientBeginDeployOptions contains the optional parameters for the FirewallPolicyDeploymentsClient.BeginDeploy @@ -73,7 +70,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *FirewallPolicyDeploymentsClient) deploy(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDeploymentsClientBeginDeployOptions) (*http.Response, error) { var err error const operationName = "FirewallPolicyDeploymentsClient.BeginDeploy" @@ -96,7 +93,7 @@ func (client *FirewallPolicyDeploymentsClient) deploy(ctx context.Context, resou } // deployCreateRequest creates the Deploy request. -func (client *FirewallPolicyDeploymentsClient) deployCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDeploymentsClientBeginDeployOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -115,7 +112,7 @@ func (client *FirewallPolicyDeploymentsClient) deployCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 deleted file mode 100644 index c3f9aff501a8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydeployments_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFirewallPolicyDeploymentsClient().BeginDeploy(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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go index 30bd0cf26f6d..89008fcdcd87 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Parameters supplied to the create or update Firewall Policy Draft operation. @@ -76,7 +73,7 @@ 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, options *FirewallPolicyDraftsClientCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -95,7 +92,7 @@ func (client *FirewallPolicyDraftsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +113,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientDeleteOptions contains the optional parameters for the FirewallPolicyDraftsClient.Delete @@ -143,7 +140,7 @@ func (client *FirewallPolicyDraftsClient) Delete(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDraftsClientDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -162,7 +159,7 @@ func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +168,7 @@ func (client *FirewallPolicyDraftsClient) deleteCreateRequest(ctx context.Contex // Get - Get a draft Firewall Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyDraftsClientGetOptions contains the optional parameters for the FirewallPolicyDraftsClient.Get @@ -199,7 +196,7 @@ func (client *FirewallPolicyDraftsClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *FirewallPolicyDraftsClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyDraftsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -218,7 +215,7 @@ func (client *FirewallPolicyDraftsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index efd5a47c62c0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicydrafts_client_example_test.go +++ /dev/null @@ -1,311 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyDraftsClient().CreateOrUpdate(ctx, "rg1", "firewallPolicy", armnetwork.FirewallPolicyDraft{ - 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), - 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"), - }, - 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), - 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")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // ExplicitProxy: &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"), - // }, - // 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), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFirewallPolicyDraftsClient().Delete(ctx, "rg1", "firewallPolicy", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyDraftsClient().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.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")}, - // }, - // ExplicitProxy: &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"), - // }, - // 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), - // }, - // 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 f9209a0d946c..4eea6b6e61e1 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string, credential azc // 1000. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesClient.List @@ -76,7 +73,7 @@ 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, options *FirewallPolicyIdpsSignaturesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -95,7 +92,7 @@ func (client *FirewallPolicyIdpsSignaturesClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go deleted file mode 100644 index 63344d3ea2a1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignatures_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesClient().List(ctx, "rg1", "firewallPolicy", armnetwork.IDPSQueryObject{ - Filters: []*armnetwork.FilterItems{ - { - Field: to.Ptr("Mode"), - Values: []*string{ - to.Ptr("Deny")}, - }}, - OrderBy: &armnetwork.OrderBy{ - Field: to.Ptr("severity"), - Order: to.Ptr(armnetwork.FirewallPolicyIDPSQuerySortOrderAscending), - }, - ResultsPerPage: to.Ptr[int32](20), - Search: to.Ptr(""), - Skip: to.Ptr[int32](0), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // 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), - // SignatureID: to.Ptr[int32](2000015), - // SourcePorts: []*string{ - // 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")}, - // Protocol: to.Ptr("http"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go index e199e4a0eabc..c4e81cf91f3d 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesFilterValuesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesFilterValuesClient.List @@ -75,7 +72,7 @@ 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, options *FirewallPolicyIdpsSignaturesFilterValuesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *FirewallPolicyIdpsSignaturesFilterValuesClient) listCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go deleted file mode 100644 index 55084e40d157..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesfiltervalues_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyIdpsSignaturesFilterValuesClient().List(ctx, "rg1", "firewallPolicy", armnetwork.SignatureOverridesFilterValuesQuery{ - FilterName: to.Ptr("severity"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go index 1daa0d656561..8faf08389f98 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientGetOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.Get @@ -75,7 +72,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Conte } // getCreateRequest creates the Get request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +109,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyIdpsSignaturesOverridesClientListOptions contains the optional parameters for the FirewallPolicyIdpsSignaturesOverridesClient.List @@ -140,7 +137,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Cont } // listCreateRequest creates the List request. -func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyIdpsSignaturesOverridesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -159,7 +156,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +174,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put @@ -206,7 +203,7 @@ 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, options *FirewallPolicyIdpsSignaturesOverridesClientPatchOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -225,7 +222,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) patchCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -246,7 +243,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - parameters - Will contain all properties of the object to put @@ -275,7 +272,7 @@ 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, options *FirewallPolicyIdpsSignaturesOverridesClientPutOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -294,7 +291,7 @@ func (client *FirewallPolicyIdpsSignaturesOverridesClient) putCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go deleted file mode 100644 index 846ec05cc370..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyidpssignaturesoverrides_client_example_test.go +++ /dev/null @@ -1,166 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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"), - // }, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go index 742cf9a22c5f..585f93139830 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -77,7 +74,7 @@ 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, options *FirewallPolicyRuleCollectionGroupDraftsClientCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,7 +118,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) createOrUpdateHandl // Delete - Delete Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -149,7 +146,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) Delete(ctx context. } // deleteCreateRequest creates the Delete request. -func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupDraftsClientDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -172,7 +169,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) deleteCreateRequest // Get - Get Rule Collection Group Draft. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -210,7 +207,7 @@ 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, options *FirewallPolicyRuleCollectionGroupDraftsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -233,7 +230,7 @@ func (client *FirewallPolicyRuleCollectionGroupDraftsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 35329417f1ce..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroupdrafts_client_example_test.go +++ /dev/null @@ -1,160 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupDraftsClient().CreateOrUpdate(ctx, "rg1", "firewallPolicy", "ruleCollectionGroup1", armnetwork.FirewallPolicyRuleCollectionGroupDraft{ - 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("*")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - SourceAddresses: []*string{ - to.Ptr("10.1.25.0/24")}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFirewallPolicyRuleCollectionGroupDraftsClient().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.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("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // 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 67655c097e00..0b9225d5afe9 100644 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) createOrUpdateCreateRequ // BeginDelete - Deletes the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteOperation(ctx cont } // deleteCreateRequest creates the Delete request. -func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, options *FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) deleteCreateRequest(ctx // Get - Gets the specified FirewallPolicyRuleCollectionGroup. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - ruleCollectionGroupName - The name of the FirewallPolicyRuleCollectionGroup. @@ -244,7 +241,7 @@ 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, options *FirewallPolicyRuleCollectionGroupsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) getHandleResponse(resp * // NewListPager - Lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - firewallPolicyName - The name of the Firewall Policy. // - options - FirewallPolicyRuleCollectionGroupsClientListOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.NewListPager @@ -313,7 +310,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) NewListPager(resourceGro } // listCreateRequest creates the List request. -func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, firewallPolicyName string, options *FirewallPolicyRuleCollectionGroupsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *FirewallPolicyRuleCollectionGroupsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 64d179a3b156..000000000000 --- a/sdk/resourcemanager/network/armnetwork/firewallpolicyrulecollectiongroups_client_example_test.go +++ /dev/null @@ -1,866 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - 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")}, - 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"), - }}, - }}, - }, - }, nil) - if 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.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")}, - // 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"), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - 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")}, - }}, - }}, - }, - }, nil) - if 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.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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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.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")}, - DestinationPorts: []*string{ - to.Ptr("*")}, - IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - SourceIPGroups: []*string{ - to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/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 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.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")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceIPGroups: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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.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")}, - }}, - }}, - }, - }, nil) - if 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.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")}, - // WebCategories: []*string{ - // to.Ptr("Hacking")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // 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")}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", 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.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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", 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.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("*")}, - // DestinationPorts: []*string{ - // to.Ptr("*")}, - // IPProtocols: []*armnetwork.FirewallPolicyRuleNetworkProtocol{ - // to.Ptr(armnetwork.FirewallPolicyRuleNetworkProtocolTCP)}, - // SourceAddresses: []*string{ - // to.Ptr("10.1.25.0/24")}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFirewallPolicyRuleCollectionGroupsClient().NewListPager("rg1", "firewallPolicy", 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.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")}, - // }}, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go index 18d8d6a1c3b6..4746f086b4ff 100644 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client.go +++ b/sdk/resourcemanager/network/armnetwork/flowlogs_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *FlowLogsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *FlowLogsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -182,7 +179,7 @@ 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, options *FlowLogsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -205,7 +202,7 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *FlowLogsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets a flow log resource by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log resource. @@ -242,7 +239,7 @@ 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, options *FlowLogsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -265,7 +262,7 @@ func (client *FlowLogsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +279,7 @@ func (client *FlowLogsClient) getHandleResponse(resp *http.Response) (FlowLogsCl // NewListPager - Lists all flow log resources for the specified Network Watcher. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group containing Network Watcher. // - networkWatcherName - The name of the Network Watcher resource. // - options - FlowLogsClientListOptions contains the optional parameters for the FlowLogsClient.NewListPager method. @@ -310,7 +307,7 @@ func (client *FlowLogsClient) NewListPager(resourceGroupName string, networkWatc } // listCreateRequest creates the List request. -func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *FlowLogsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +326,7 @@ func (client *FlowLogsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +344,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - flowLogName - The name of the flow log. @@ -376,7 +373,7 @@ 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, options *FlowLogsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -399,7 +396,7 @@ func (client *FlowLogsClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go deleted file mode 100644 index 6ede81c2cf53..000000000000 --- a/sdk/resourcemanager/network/armnetwork/flowlogs_client_example_test.go +++ /dev/null @@ -1,341 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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": {}, - }, - }, - 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"), - 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"), - }, - }, nil) - if 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.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"), - // }, - // }, - // }, - // 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), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFlowLogsClient().Get(ctx, "rg1", "nw1", "flowLog1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }, - // 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), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFlowLogsClient().NewListPager("rg1", "nw1", 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.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"), - // }, - // }, - // }, - // 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), - // 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"), - // }, - // }, - // }, - // 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), - // RetentionPolicy: &armnetwork.RetentionPolicyParameters{ - // Days: to.Ptr[int32](0), - // Enabled: to.Ptr(false), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/go.mod b/sdk/resourcemanager/network/armnetwork/go.mod index 28fae067362d..113564e173a9 100644 --- a/sdk/resourcemanager/network/armnetwork/go.mod +++ b/sdk/resourcemanager/network/armnetwork/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7 go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.10.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/network/armnetwork/groups_client.go b/sdk/resourcemanager/network/armnetwork/groups_client.go index beaac1f2519e..e1be5842d03a 100644 --- a/sdk/resourcemanager/network/armnetwork/groups_client.go +++ b/sdk/resourcemanager/network/armnetwork/groups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -100,7 +97,7 @@ func (client *GroupsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -127,7 +124,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -199,7 +196,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -211,7 +208,7 @@ func (client *GroupsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the specified network group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -239,7 +236,7 @@ func (client *GroupsClient) Get(ctx context.Context, resourceGroupName string, n } // getCreateRequest creates the Get request. -func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, options *GroupsClientGetOptions) (*policy.Request, error) { +func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, _ *GroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -262,7 +259,7 @@ func (client *GroupsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +276,7 @@ func (client *GroupsClient) getHandleResponse(resp *http.Response) (GroupsClient // NewListPager - Lists the specified network group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - GroupsClientListOptions contains the optional parameters for the GroupsClient.NewListPager method. @@ -332,7 +329,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index ed111b3fb5ae..000000000000 --- a/sdk/resourcemanager/network/armnetwork/groups_client_example_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGroupsClient().Get(ctx, "rg1", "testNetworkManager", "testNetworkGroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGroupsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.GroupsClientListOptions{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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go index 8fb1ea571a78..d14ee9255529 100644 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubroutetables_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *HubRouteTablesClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, options *HubRouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable, _ *HubRouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *HubRouteTablesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeTableParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RouteTable. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *HubRouteTablesClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, _ *HubRouteTablesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *HubRouteTablesClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves the details of a RouteTable. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the RouteTable. @@ -243,7 +240,7 @@ func (client *HubRouteTablesClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *HubRouteTablesClientGetOptions) (*policy.Request, error) { +func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, _ *HubRouteTablesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -266,7 +263,7 @@ func (client *HubRouteTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ func (client *HubRouteTablesClient) getHandleResponse(resp *http.Response) (HubR // NewListPager - Retrieves the details of all RouteTables. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - HubRouteTablesClientListOptions contains the optional parameters for the HubRouteTablesClient.NewListPager method. @@ -311,7 +308,7 @@ func (client *HubRouteTablesClient) NewListPager(resourceGroupName string, virtu } // listCreateRequest creates the List request. -func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubRouteTablesClientListOptions) (*policy.Request, error) { +func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *HubRouteTablesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -330,7 +327,7 @@ func (client *HubRouteTablesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 1da52bcb2b6e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/hubroutetables_client_example_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "hubRouteTable1", armnetwork.HubRouteTable{ - Properties: &armnetwork.HubRouteTableProperties{ - Labels: []*string{ - to.Ptr("label1"), - to.Ptr("label2")}, - 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"), - }}, - }, - }, nil) - if 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.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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHubRouteTablesClient().Get(ctx, "rg1", "virtualHub1", "hubRouteTable1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubRouteTablesClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHubRouteTablesClient().NewListPager("rg1", "virtualHub1", 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.ListHubRouteTablesResult = armnetwork.ListHubRouteTablesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go index 7159fff7c2e2..6c4b7a174c87 100644 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the HubVirtualNetworkConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdate(ctx context.Con } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, options *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection, _ *HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, hubVirtualNetworkConnectionParameters); err != nil { @@ -133,7 +130,7 @@ func (client *HubVirtualNetworkConnectionsClient) createOrUpdateCreateRequest(ct // BeginDelete - Deletes a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the HubVirtualNetworkConnection. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteOperation(ctx context.Co } // deleteCreateRequest creates the Delete request. -func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, _ *HubVirtualNetworkConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *HubVirtualNetworkConnectionsClient) deleteCreateRequest(ctx contex // Get - Retrieves the details of a HubVirtualNetworkConnection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the vpn connection. @@ -244,7 +241,7 @@ func (client *HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *HubVirtualNetworkConnectionsClientGetOptions) (*policy.Request, error) { +func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, _ *HubVirtualNetworkConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *HubVirtualNetworkConnectionsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *HubVirtualNetworkConnectionsClient) getHandleResponse(resp *http.R // NewListPager - Retrieves the details of all HubVirtualNetworkConnections. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - HubVirtualNetworkConnectionsClientListOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.NewListPager @@ -313,7 +310,7 @@ func (client *HubVirtualNetworkConnectionsClient) NewListPager(resourceGroupName } // listCreateRequest creates the List request. -func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *HubVirtualNetworkConnectionsClientListOptions) (*policy.Request, error) { +func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *HubVirtualNetworkConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *HubVirtualNetworkConnectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 648c629ab8f6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/hubvirtualnetworkconnections_client_example_test.go +++ /dev/null @@ -1,278 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubVirtualNetworkConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "connection1", armnetwork.HubVirtualNetworkConnection{ - Properties: &armnetwork.HubVirtualNetworkConnectionProperties{ - EnableInternetSecurity: to.Ptr(false), - 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"), - }, - 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")}, - }, - VnetRoutes: &armnetwork.VnetRoute{ - 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{ - VnetLocalRouteOverrideCriteria: to.Ptr(armnetwork.VnetLocalRouteOverrideCriteriaEqual), - }, - }, - }, - }, - }, nil) - if 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.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"), - // }, - // 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")}, - // }, - // VnetRoutes: &armnetwork.VnetRoute{ - // BgpConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/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), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHubVirtualNetworkConnectionsClient().BeginDelete(ctx, "rg1", "virtualHub1", "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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHubVirtualNetworkConnectionsClient().Get(ctx, "rg1", "virtualHub1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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"), - // }, - // { - // 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{ - // BgpConnections: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/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), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHubVirtualNetworkConnectionsClient().NewListPager("rg1", "virtualHub1", 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.ListHubVirtualNetworkConnectionsResult = armnetwork.ListHubVirtualNetworkConnectionsResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go index 0766cd160325..26c84b9ddf59 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundnatrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *InboundNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *InboundNatRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, inboundNatRuleParameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *InboundNatRulesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *InboundNatRulesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the specified load balancer inbound NAT rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - inboundNatRuleName - The name of the inbound NAT rule. @@ -269,7 +266,7 @@ func (client *InboundNatRulesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +283,7 @@ func (client *InboundNatRulesClient) getHandleResponse(resp *http.Response) (Inb // NewListPager - Gets all the inbound NAT rules in a load balancer. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - InboundNatRulesClientListOptions contains the optional parameters for the InboundNatRulesClient.NewListPager @@ -315,7 +312,7 @@ func (client *InboundNatRulesClient) NewListPager(resourceGroupName string, load } // listCreateRequest creates the List request. -func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *InboundNatRulesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -334,7 +331,7 @@ func (client *InboundNatRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 747bfecb963b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/inboundnatrules_client_example_test.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInboundNatRulesClient().BeginDelete(ctx, "testrg", "lb1", "natRule1.1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 5471a9f4a039..69538d57afa1 100644 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go +++ b/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - ruleCollectionName - The name of security rule collection. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *InboundSecurityRuleClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *InboundSecurityRuleClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - ruleCollectionName - The name of security rule collection. @@ -161,7 +158,7 @@ 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, options *InboundSecurityRuleClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -184,7 +181,7 @@ func (client *InboundSecurityRuleClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a87dfc43364c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/inboundsecurityrule_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInboundSecurityRuleClient().BeginCreateOrUpdate(ctx, "rg1", "nva", "rule1", armnetwork.InboundSecurityRule{ - Properties: &armnetwork.InboundSecurityRuleProperties{ - 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), - }}, - }, - }, nil) - if 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.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")}, - // DestinationPortRange: to.Ptr[int32](22), - // DestinationPortRanges: []*string{ - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInboundSecurityRuleClient().Get(ctx, "rg1", "nva", "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.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")}, - // DestinationPortRange: to.Ptr[int32](22), - // DestinationPortRanges: []*string{ - // to.Ptr("80-100")}, - // SourceAddressPrefix: to.Ptr("50.20.121.5/32"), - // Protocol: to.Ptr(armnetwork.InboundSecurityRulesProtocolTCP), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go index 50c4d89ec2ec..85fc99505f09 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - ipConfigurationName - The name of the ip configuration name. @@ -76,7 +73,7 @@ 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, options *InterfaceIPConfigurationsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *InterfaceIPConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +113,7 @@ func (client *InterfaceIPConfigurationsClient) getHandleResponse(resp *http.Resp // NewListPager - Get all ip configurations in a network interface. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceIPConfigurationsClientListOptions contains the optional parameters for the InterfaceIPConfigurationsClient.NewListPager @@ -145,7 +142,7 @@ func (client *InterfaceIPConfigurationsClient) NewListPager(resourceGroupName st } // listCreateRequest creates the List request. -func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceIPConfigurationsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -164,7 +161,7 @@ func (client *InterfaceIPConfigurationsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 1a5f09eeb997..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaceipconfigurations_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceIPConfigurationsClient().NewListPager("testrg", "nic1", 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/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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 699183c3fc82..f4c2e4fdcda1 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewInterfaceLoadBalancersClient(subscriptionID string, credential azcore.To // NewListPager - List all load balancers in a network interface. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceLoadBalancersClientListOptions contains the optional parameters for the InterfaceLoadBalancersClient.NewListPager @@ -75,7 +72,7 @@ func (client *InterfaceLoadBalancersClient) NewListPager(resourceGroupName strin } // listCreateRequest creates the List request. -func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceLoadBalancersClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *InterfaceLoadBalancersClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7108e217b658..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaceloadbalancers_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceLoadBalancersClient().NewListPager("testrg", "nic1", 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.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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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"), - // }, - // 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"), - // }, - // 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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Protocol: to.Ptr(armnetwork.TransportProtocolTCP), - // }, - // }}, - // OutboundRules: []*armnetwork.OutboundRule{ - // }, - // 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 a153dd5768ce..8a3acf9a2b29 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client.go b/sdk/resourcemanager/network/armnetwork/interfaces_client.go index 9d511dabede7..9793e81183e7 100644 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfaces_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to the create or update network interface operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *InterfacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *InterfacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *InterfacesClient) deleteOperation(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -195,7 +192,7 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *InterfacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets information about the specified network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientGetOptions contains the optional parameters for the InterfacesClient.Get method. @@ -253,7 +250,7 @@ func (client *InterfacesClient) getCreateRequest(ctx context.Context, resourceGr if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -331,7 +328,7 @@ func (client *InterfacesClient) getCloudServiceNetworkInterfaceCreateRequest(ctx if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +346,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable @@ -375,7 +372,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginGetEffectiveRouteTable" @@ -398,7 +395,7 @@ func (client *InterfacesClient) getEffectiveRouteTable(ctx context.Context, reso } // getEffectiveRouteTableCreateRequest creates the GetEffectiveRouteTable request. -func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginGetEffectiveRouteTableOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -417,7 +414,7 @@ func (client *InterfacesClient) getEffectiveRouteTableCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -587,7 +584,7 @@ func (client *InterfacesClient) getVirtualMachineScaleSetNetworkInterfaceHandleR // NewListPager - Gets all network interfaces in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - InterfacesClientListOptions contains the optional parameters for the InterfacesClient.NewListPager method. func (client *InterfacesClient) NewListPager(resourceGroupName string, options *InterfacesClientListOptions) *runtime.Pager[InterfacesClientListResponse] { @@ -614,7 +611,7 @@ func (client *InterfacesClient) NewListPager(resourceGroupName string, options * } // listCreateRequest creates the List request. -func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *InterfacesClientListOptions) (*policy.Request, error) { +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") @@ -629,7 +626,7 @@ func (client *InterfacesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +643,7 @@ func (client *InterfacesClient) listHandleResponse(resp *http.Response) (Interfa // NewListAllPager - Gets all network interfaces in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -672,7 +669,7 @@ func (client *InterfacesClient) NewListAllPager(options *InterfacesClientListAll } // listAllCreateRequest creates the ListAll request. -func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, options *InterfacesClientListAllOptions) (*policy.Request, error) { +func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, _ *InterfacesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -683,7 +680,7 @@ func (client *InterfacesClient) listAllCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -700,7 +697,7 @@ func (client *InterfacesClient) listAllHandleResponse(resp *http.Response) (Inte // NewListCloudServiceNetworkInterfacesPager - Gets all network interfaces in a cloud service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - options - InterfacesClientListCloudServiceNetworkInterfacesOptions contains the optional parameters for the InterfacesClient.NewListCloudServiceNetworkInterfacesPager @@ -729,7 +726,7 @@ func (client *InterfacesClient) NewListCloudServiceNetworkInterfacesPager(resour } // listCloudServiceNetworkInterfacesCreateRequest creates the ListCloudServiceNetworkInterfaces request. -func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *InterfacesClientListCloudServiceNetworkInterfacesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -748,7 +745,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -766,7 +763,7 @@ func (client *InterfacesClient) listCloudServiceNetworkInterfacesHandleResponse( // NewListCloudServiceRoleInstanceNetworkInterfacesPager - Gets information about all network interfaces in a role instance // in a cloud service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -796,7 +793,7 @@ func (client *InterfacesClient) NewListCloudServiceRoleInstanceNetworkInterfaces } // listCloudServiceRoleInstanceNetworkInterfacesCreateRequest creates the ListCloudServiceRoleInstanceNetworkInterfaces request. -func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, options *InterfacesClientListCloudServiceRoleInstanceNetworkInterfacesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -819,7 +816,7 @@ func (client *InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +834,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups @@ -863,7 +860,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*http.Response, error) { var err error const operationName = "InterfacesClient.BeginListEffectiveNetworkSecurityGroups" @@ -886,7 +883,7 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroups(ctx context.C } // listEffectiveNetworkSecurityGroupsCreateRequest creates the ListEffectiveNetworkSecurityGroups request. -func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -905,7 +902,7 @@ func (client *InterfacesClient) listEffectiveNetworkSecurityGroupsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1021,7 +1018,7 @@ func (client *InterfacesClient) NewListVirtualMachineScaleSetNetworkInterfacesPa } // listVirtualMachineScaleSetNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetNetworkInterfaces request. -func (client *InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *InterfacesClientListVirtualMachineScaleSetNetworkInterfacesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1088,7 +1085,7 @@ func (client *InterfacesClient) NewListVirtualMachineScaleSetVMNetworkInterfaces } // listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest creates the ListVirtualMachineScaleSetVMNetworkInterfaces request. -func (client *InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, options *InterfacesClientListVirtualMachineScaleSetVMNetworkInterfacesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1129,7 +1126,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - parameters - Parameters supplied to update network interface tags. @@ -1157,7 +1154,7 @@ 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, options *InterfacesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1176,7 +1173,7 @@ func (client *InterfacesClient) updateTagsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go deleted file mode 100644 index 56f9cacd479e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfaces_client_example_test.go +++ /dev/null @@ -1,1403 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfacesClient().BeginDelete(ctx, "rg1", "test-nic", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfacesClient().Get(ctx, "rg1", "test-nic", &armnetwork.InterfacesClientGetOptions{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.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{ - // }, - // 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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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{ - // 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{ - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // }, - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().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.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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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{ - // }, - // }, - // 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"), - // }, - // Subnet: &armnetwork.Subnet{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rgnew/providers/Microsoft.Network/virtualNetworks/rgnew-vnet2/subnets/default"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfacesClient().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.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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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{ - // }, - // }, - // 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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VnetEncryptionSupported: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssVmNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetVMNetworkInterfacesPager() { - cred, err := 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().NewListVirtualMachineScaleSetVMNetworkInterfacesPager("rg1", "vmss1", "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.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{ - // }, - // 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/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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssNetworkInterfaceList.json -func ExampleInterfacesClient_NewListVirtualMachineScaleSetNetworkInterfacesPager() { - cred, err := 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().NewListVirtualMachineScaleSetNetworkInterfacesPager("rg1", "vmss1", 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/virtualMachineScaleSets/vmss1/virtualMachines/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/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"), - // }, - // }, - // }}, - // 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{ - // }, - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssNetworkInterfaceGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetNetworkInterface() { - cred, err := 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().GetVirtualMachineScaleSetNetworkInterface(ctx, "rg1", "vmss1", "1", "nic1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions{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.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{ - // { - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssNetworkInterfaceIpConfigGet.json -func ExampleInterfacesClient_GetVirtualMachineScaleSetIPConfiguration() { - cred, err := 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().GetVirtualMachineScaleSetIPConfiguration(ctx, "rg1", "vmss1", "2", "nic1", "ip1", &armnetwork.InterfacesClientGetVirtualMachineScaleSetIPConfigurationOptions{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.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"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go index 7b2f499f1dfd..2b9fc316f860 100644 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *InterfaceTapConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapConfigurationParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *InterfaceTapConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *InterfaceTapConfigurationsClient) deleteCreateRequest(ctx context. // Get - Get the specified tap configuration on a network interface. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - tapConfigurationName - The name of the tap configuration. @@ -244,7 +241,7 @@ 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, options *InterfaceTapConfigurationsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *InterfaceTapConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *InterfaceTapConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - Get all Tap configurations in a network interface. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkInterfaceName - The name of the network interface. // - options - InterfaceTapConfigurationsClientListOptions contains the optional parameters for the InterfaceTapConfigurationsClient.NewListPager @@ -313,7 +310,7 @@ func (client *InterfaceTapConfigurationsClient) NewListPager(resourceGroupName s } // listCreateRequest creates the List request. -func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkInterfaceName string, options *InterfaceTapConfigurationsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *InterfaceTapConfigurationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 276de65d8eaa..000000000000 --- a/sdk/resourcemanager/network/armnetwork/interfacetapconfigurations_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInterfaceTapConfigurationsClient().BeginDelete(ctx, "testrg", "mynic", "tapconfiguration1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInterfaceTapConfigurationsClient().Get(ctx, "testrg", "mynic", "tapconfiguration1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInterfaceTapConfigurationsClient().NewListPager("testrg", "mynic", 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.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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go index 6cd53bcbacba..78e5cb2b6c7d 100644 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipallocations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to the create or update virtual network operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *IPAllocationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *IPAllocationsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPAllocationsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *IPAllocationsClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipAllocationName string, options *IPAllocationsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *IPAllocationsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified IpAllocation by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - options - IPAllocationsClientGetOptions contains the optional parameters for the IPAllocationsClient.Get method. @@ -254,7 +251,7 @@ func (client *IPAllocationsClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *IPAllocationsClient) getHandleResponse(resp *http.Response) (IPAll // NewListPager - Gets all IpAllocations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -297,7 +294,7 @@ func (client *IPAllocationsClient) NewListPager(options *IPAllocationsClientList } // listCreateRequest creates the List request. -func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, options *IPAllocationsClientListOptions) (*policy.Request, error) { +func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, _ *IPAllocationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -308,7 +305,7 @@ func (client *IPAllocationsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +322,7 @@ func (client *IPAllocationsClient) listHandleResponse(resp *http.Response) (IPAl // NewListByResourceGroupPager - Gets all IpAllocations in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - IPAllocationsClientListByResourceGroupOptions contains the optional parameters for the IPAllocationsClient.NewListByResourceGroupPager // method. @@ -353,7 +350,7 @@ func (client *IPAllocationsClient) NewListByResourceGroupPager(resourceGroupName } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPAllocationsClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -368,7 +365,7 @@ func (client *IPAllocationsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipAllocationName - The name of the IpAllocation. // - parameters - Parameters supplied to update IpAllocation tags. @@ -415,7 +412,7 @@ 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, options *IPAllocationsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -434,7 +431,7 @@ func (client *IPAllocationsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go deleted file mode 100644 index e5ce0e0c5049..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipallocations_client_example_test.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPAllocationsClient().BeginDelete(ctx, "rg1", "test-ipallocation", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPAllocationsClient().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.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"), - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPAllocationsClient().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.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"), - // }, - // 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"), - // }, - // IpamAllocationID: to.Ptr("57dc7256-2ff7-43f2-b9c8-85a70b5c6408"), - // Prefix: to.Ptr("3.2.6.0/24"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipampools_client.go b/sdk/resourcemanager/network/armnetwork/ipampools_client.go index 000dd7cb97b3..130091e22280 100644 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipampools_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 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" @@ -98,7 +95,7 @@ func (client *IpamPoolsClient) create(ctx context.Context, resourceGroupName str } // createCreateRequest creates the Create request. -func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPool, options *IpamPoolsClientBeginCreateOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, body IpamPool, _ *IpamPoolsClientBeginCreateOptions) (*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") @@ -121,7 +118,7 @@ func (client *IpamPoolsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 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" @@ -182,7 +179,7 @@ func (client *IpamPoolsClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, _ *IpamPoolsClientBeginDeleteOptions) (*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") @@ -205,7 +202,7 @@ func (client *IpamPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -242,7 +239,7 @@ func (client *IpamPoolsClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *IpamPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientGetOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, _ *IpamPoolsClientGetOptions) (*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") @@ -265,7 +262,7 @@ func (client *IpamPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -311,7 +308,7 @@ func (client *IpamPoolsClient) GetPoolUsage(ctx context.Context, resourceGroupNa } // getPoolUsageCreateRequest creates the GetPoolUsage request. -func (client *IpamPoolsClient) getPoolUsageCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientGetPoolUsageOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) getPoolUsageCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, _ *IpamPoolsClientGetPoolUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/ipamPools/{poolName}/getPoolUsage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -334,7 +331,7 @@ func (client *IpamPoolsClient) getPoolUsageCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +348,7 @@ func (client *IpamPoolsClient) getPoolUsageHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Pool resources at Network Manager level. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - IpamPoolsClientListOptions contains the optional parameters for the IpamPoolsClient.NewListPager method. @@ -398,7 +395,7 @@ func (client *IpamPoolsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -430,7 +427,7 @@ func (client *IpamPoolsClient) listHandleResponse(resp *http.Response) (IpamPool // NewListAssociatedResourcesPager - List Associated Resource in the Pool. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -460,7 +457,7 @@ func (client *IpamPoolsClient) NewListAssociatedResourcesPager(resourceGroupName } // listAssociatedResourcesCreateRequest creates the ListAssociatedResources request. -func (client *IpamPoolsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, options *IpamPoolsClientListAssociatedResourcesOptions) (*policy.Request, error) { +func (client *IpamPoolsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, _ *IpamPoolsClientListAssociatedResourcesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/ipamPools/{poolName}/listAssociatedResources" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -483,7 +480,7 @@ func (client *IpamPoolsClient) listAssociatedResourcesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +498,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -552,7 +549,7 @@ func (client *IpamPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go deleted file mode 100644 index 79c495c783d6..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipampools_client_example_test.go +++ /dev/null @@ -1,351 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIpamPoolsClient().BeginCreate(ctx, "rg1", "TestNetworkManager", "TestPool", armnetwork.IpamPool{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.IpamPoolProperties{ - Description: to.Ptr("Test description."), - AddressPrefixes: []*string{ - to.Ptr("10.0.0.0/24")}, - ParentPoolName: to.Ptr(""), - }, - }, nil) - if 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.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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIpamPoolsClient().Update(ctx, "rg1", "TestNetworkManager", "TestPool", &armnetwork.IpamPoolsClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIpamPoolsClient().Get(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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIpamPoolsClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIpamPoolsClient().NewListAssociatedResourcesPager("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.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}()), - // 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"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go index 4bbb8e0be173..6de505b70fb3 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the create or update IpGroups operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *IPGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *IPGroupsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "IPGroupsClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *IPGroupsClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ipGroupsName string, options *IPGroupsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -195,7 +192,7 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *IPGroupsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified ipGroups. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - options - IPGroupsClientGetOptions contains the optional parameters for the IPGroupsClient.Get method. @@ -253,7 +250,7 @@ func (client *IPGroupsClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *IPGroupsClient) getHandleResponse(resp *http.Response) (IPGroupsCl // NewListPager - Gets all IpGroups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -296,7 +293,7 @@ func (client *IPGroupsClient) NewListPager(options *IPGroupsClientListOptions) * } // listCreateRequest creates the List request. -func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IPGroupsClientListOptions) (*policy.Request, error) { +func (client *IPGroupsClient) listCreateRequest(ctx context.Context, _ *IPGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -307,7 +304,7 @@ func (client *IPGroupsClient) listCreateRequest(ctx context.Context, options *IP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +321,7 @@ func (client *IPGroupsClient) listHandleResponse(resp *http.Response) (IPGroupsC // NewListByResourceGroupPager - Gets all IpGroups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - IPGroupsClientListByResourceGroupOptions contains the optional parameters for the IPGroupsClient.NewListByResourceGroupPager // method. @@ -352,7 +349,7 @@ func (client *IPGroupsClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *IPGroupsClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -367,7 +364,7 @@ func (client *IPGroupsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - ipGroupsName - The name of the ipGroups. // - parameters - Parameters supplied to the update ipGroups operation. @@ -413,7 +410,7 @@ 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, options *IPGroupsClientUpdateGroupsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -432,7 +429,7 @@ func (client *IPGroupsClient) updateGroupsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go deleted file mode 100644 index 68c555b9373c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_client_example_test.go +++ /dev/null @@ -1,320 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPGroupsClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPGroupsClient().NewListByResourceGroupPager("myResourceGroup", 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.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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("ipGroups2"), - // 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\\"), - // 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("14.64.39.16/32"), - // to.Ptr("41.74.146.80/31"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPGroupsClient().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.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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("iptag2"), - // 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\\"), - // 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("14.64.39.16/32"), - // to.Ptr("41.74.146.80/31"), - // to.Ptr("42.74.147.32/28")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go index c6feaf7b192f..17a452bf9a7c 100644 --- a/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/ipgroups_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 5b60718fe29a..ece0f1fde28b 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancer_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go index 23379642890b..e5baaf6cced0 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) createOrUpdateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteOperation(ctx context } // deleteCreateRequest creates the Delete request. -func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, options *LoadBalancerBackendAddressPoolsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) deleteCreateRequest(ctx con // Get - Gets load balancer backend address pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - backendAddressPoolName - The name of the backend address pool. @@ -244,7 +241,7 @@ 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, options *LoadBalancerBackendAddressPoolsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) getHandleResponse(resp *htt // NewListPager - Gets all the load balancer backed address pools. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerBackendAddressPoolsClientListOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.NewListPager @@ -313,7 +310,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) NewListPager(resourceGroupN } // listCreateRequest creates the List request. -func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerBackendAddressPoolsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *LoadBalancerBackendAddressPoolsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 61ef9ff970da..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerbackendaddresspools_client_example_test.go +++ /dev/null @@ -1,312 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().Get(ctx, "testrg", "lb", "backend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerBackendAddressPoolsClient().Get(ctx, "testrg", "lb", "backend", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go index c5a4b6f88191..540a2babd2ec 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - frontendIPConfigurationName - The name of the frontend IP configuration. @@ -76,7 +73,7 @@ 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, options *LoadBalancerFrontendIPConfigurationsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +113,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) getHandleResponse(resp // NewListPager - Gets all the load balancer frontend IP configurations. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerFrontendIPConfigurationsClientListOptions contains the optional parameters for the LoadBalancerFrontendIPConfigurationsClient.NewListPager @@ -145,7 +142,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) NewListPager(resourceG } // listCreateRequest creates the List request. -func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerFrontendIPConfigurationsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -164,7 +161,7 @@ func (client *LoadBalancerFrontendIPConfigurationsClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 70ec3338da9f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerfrontendipconfigurations_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerFrontendIPConfigurationsClient().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.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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 b8ad74fe6fda..03c546fe96de 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. @@ -76,7 +73,7 @@ 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, options *LoadBalancerLoadBalancingRulesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +114,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - groupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - loadBalancingRuleName - The name of the load balancing rule. @@ -144,7 +141,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -167,7 +164,7 @@ 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, options *LoadBalancerLoadBalancingRulesClientBeginHealthOptions) (*policy.Request, error) { +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 groupName == "" { return nil, errors.New("parameter groupName cannot be empty") @@ -190,7 +187,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +195,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) healthCreateRequest(ctx cont // NewListPager - Gets all the load balancing rules in a load balancer. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerLoadBalancingRulesClientListOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.NewListPager @@ -227,7 +224,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) NewListPager(resourceGroupNa } // listCreateRequest creates the List request. -func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerLoadBalancingRulesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -246,7 +243,7 @@ func (client *LoadBalancerLoadBalancingRulesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 406d34d81a18..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerloadbalancingrules_client_example_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLoadBalancerLoadBalancingRulesClient().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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLoadBalancerLoadBalancingRulesClient().BeginHealth(ctx, "rg1", "lb1", "rulelb", nil) - if 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.LoadBalancerHealthPerRule = armnetwork.LoadBalancerHealthPerRule{ - // Down: to.Ptr[int32](0), - // LoadBalancerBackendAddresses: []*armnetwork.LoadBalancerHealthPerRulePerBackendAddress{ - // { - // IPAddress: to.Ptr("10.1.0.4"), - // NetworkInterfaceIPConfigurationID: &armnetwork.InterfaceIPConfiguration{ - // }, - // Reason: to.Ptr("Up_Probe_Success"), - // State: to.Ptr("Up"), - // }}, - // Up: to.Ptr[int32](1), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go index 27426ef64db9..4353290904eb 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewLoadBalancerNetworkInterfacesClient(subscriptionID string, credential az // NewListPager - Gets associated load balancer network interfaces. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerNetworkInterfacesClientListOptions contains the optional parameters for the LoadBalancerNetworkInterfacesClient.NewListPager @@ -75,7 +72,7 @@ func (client *LoadBalancerNetworkInterfacesClient) NewListPager(resourceGroupNam } // listCreateRequest creates the List request. -func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerNetworkInterfacesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *LoadBalancerNetworkInterfacesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 3c0c9fd82a0d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancernetworkinterfaces_client_example_test.go +++ /dev/null @@ -1,210 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerNetworkInterfacesClient().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.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{ - // }, - // }, - // 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerNetworkInterfacesClient().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.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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go index d8d9724ed3ba..6ad0c70e6d0a 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - outboundRuleName - The name of the outbound rule. @@ -76,7 +73,7 @@ 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, options *LoadBalancerOutboundRulesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *LoadBalancerOutboundRulesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +113,7 @@ func (client *LoadBalancerOutboundRulesClient) getHandleResponse(resp *http.Resp // NewListPager - Gets all the outbound rules in a load balancer. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerOutboundRulesClientListOptions contains the optional parameters for the LoadBalancerOutboundRulesClient.NewListPager @@ -145,7 +142,7 @@ func (client *LoadBalancerOutboundRulesClient) NewListPager(resourceGroupName st } // listCreateRequest creates the List request. -func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerOutboundRulesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -164,7 +161,7 @@ func (client *LoadBalancerOutboundRulesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 8784fb9899b0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalanceroutboundrules_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerOutboundRulesClient().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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 5e52e1b3cc36..fba1a8dc95e5 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - probeName - The name of the probe. @@ -75,7 +72,7 @@ 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, options *LoadBalancerProbesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,7 +95,7 @@ func (client *LoadBalancerProbesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +112,7 @@ func (client *LoadBalancerProbesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets all the load balancer probes. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancerProbesClientListOptions contains the optional parameters for the LoadBalancerProbesClient.NewListPager @@ -144,7 +141,7 @@ func (client *LoadBalancerProbesClient) NewListPager(resourceGroupName string, l } // listCreateRequest creates the List request. -func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancerProbesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -163,7 +160,7 @@ func (client *LoadBalancerProbesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 846ab52d3d3e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancerprobes_client_example_test.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancerProbesClient().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.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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 0b71a6fea855..889e18ef4a45 100644 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go +++ b/sdk/resourcemanager/network/armnetwork/loadbalancers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to the create or update load balancer operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *LoadBalancersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified load balancer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. @@ -254,7 +251,7 @@ func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadB // NewListPager - Gets all the load balancers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - LoadBalancersClientListOptions contains the optional parameters for the LoadBalancersClient.NewListPager method. func (client *LoadBalancersClient) NewListPager(resourceGroupName string, options *LoadBalancersClientListOptions) *runtime.Pager[LoadBalancersClientListResponse] { @@ -298,7 +295,7 @@ func (client *LoadBalancersClient) NewListPager(resourceGroupName string, option } // listCreateRequest creates the List request. -func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LoadBalancersClientListOptions) (*policy.Request, error) { +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") @@ -313,7 +310,7 @@ func (client *LoadBalancersClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +327,7 @@ func (client *LoadBalancersClient) listHandleResponse(resp *http.Response) (Load // NewListAllPager - Gets all the load balancers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - LoadBalancersClientListAllOptions contains the optional parameters for the LoadBalancersClient.NewListAllPager // method. func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientListAllOptions) *runtime.Pager[LoadBalancersClientListAllResponse] { @@ -357,7 +354,7 @@ func (client *LoadBalancersClient) NewListAllPager(options *LoadBalancersClientL } // listAllCreateRequest creates the ListAll request. -func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, options *LoadBalancersClientListAllOptions) (*policy.Request, error) { +func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, _ *LoadBalancersClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +365,7 @@ func (client *LoadBalancersClient) listAllCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -414,7 +411,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -437,7 +434,7 @@ 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, options *LoadBalancersClientBeginListInboundNatRulePortMappingsOptions) (*policy.Request, error) { +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 groupName == "" { return nil, errors.New("parameter groupName cannot be empty") @@ -460,7 +457,7 @@ func (client *LoadBalancersClient) listInboundNatRulePortMappingsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -472,7 +469,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -519,7 +516,7 @@ func (client *LoadBalancersClient) migrateToIPBasedCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -543,7 +540,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The region where load balancers are located at. // - parameters - Parameters that define which VIPs should be swapped. // - options - LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses @@ -569,7 +566,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*http.Response, error) { var err error const operationName = "LoadBalancersClient.BeginSwapPublicIPAddresses" @@ -592,7 +589,7 @@ func (client *LoadBalancersClient) swapPublicIPAddresses(ctx context.Context, lo } // swapPublicIPAddressesCreateRequest creates the SwapPublicIPAddresses request. -func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest, options *LoadBalancersClientBeginSwapPublicIPAddressesOptions) (*policy.Request, error) { +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") @@ -607,7 +604,7 @@ func (client *LoadBalancersClient) swapPublicIPAddressesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -619,7 +616,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - loadBalancerName - The name of the load balancer. // - parameters - Parameters supplied to update load balancer tags. @@ -648,7 +645,7 @@ 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, options *LoadBalancersClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -667,7 +664,7 @@ func (client *LoadBalancersClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go deleted file mode 100644 index 2b84cfb866bf..000000000000 --- a/sdk/resourcemanager/network/armnetwork/loadbalancers_client_example_test.go +++ /dev/null @@ -1,3017 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/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), - EnableTCPReset: to.Ptr(false), - 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), - EnableTCPReset: to.Ptr(false), - 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), - }, - }}, - 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), - }, - }}, - }, - }, nil) - if 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{ - // 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), - // EnableTCPReset: to.Ptr(false), - // 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(false), - // 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.LoadBalancerSKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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/subid/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/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{ - // 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"), - // }, - // }, - // 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\""), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - 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{ - 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{ - { - 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{}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - 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](0), - 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"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolAll), - }, - }}, - 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.LoadBalancerSKUNameGateway), - }, - }, nil) - if 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), - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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.LoadBalancerSKUNameGateway), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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-lb1"), - Properties: &armnetwork.BackendAddressPoolPropertiesFormat{}, - }, - { - 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"), - }, - }, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{}, - LoadBalancingRules: []*armnetwork.LoadBalancingRule{ - { - Name: to.Ptr("rulelb"), - Properties: &armnetwork.LoadBalancingRulePropertiesFormat{ - 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/subid/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"), - }, - 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"), - }, - Protocol: to.Ptr(armnetwork.TransportProtocolAll), - }, - }}, - 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.LoadBalancerSKUNameGateway), - }, - }, nil) - if 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-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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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.LoadBalancerSKUNameGateway), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 { - 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{ - 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"), - }, - }, - }}, - }, - }}, - 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"), - }, - }, - }}, - 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(false), - 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), - }, - }}, - 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), - Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), - }, - }, nil) - if 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{ - // 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"), - // }, - // }, - // }}, - // 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.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"), - // }, - // 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), - // Tier: to.Ptr(armnetwork.LoadBalancerSKUTierGlobal), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/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{ - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - 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{}, - FrontendIPConfigurations: []*armnetwork.FrontendIPConfiguration{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test"), - Name: to.Ptr("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"), - }, - }, - Zones: []*string{}, - }}, - InboundNatPools: []*armnetwork.InboundNatPool{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test"), - Name: to.Ptr("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"), - }, - 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{}, - Probes: []*armnetwork.Probe{}, - }, - 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{ - // }, - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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{ - // }, - // Probes: []*armnetwork.Probe{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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{ - PublicIPAddress: &armnetwork.PublicIPAddress{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip"), - }, - }, - }}, - 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), - 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"), - }, - 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{ - { - 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"), - }, - FrontendIPConfigurations: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"), - }}, - Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolAll), - }, - }}, - 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"), - // }}, - // OutboundRules: []*armnetwork.SubResource{ - // { - // ID: to.Ptr("/subscriptions/subid/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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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(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"), - // }, - // 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{ - // { - // 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"), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // }}, - // 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancersClient().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.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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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"), - // }, - // 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"), - // }, - // 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), - // }, - // }}, - // 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{ - // }, - // 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"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLoadBalancersClient().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.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"), - // }, - // }, - // }}, - // 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"), - // }, - // 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"), - // }, - // 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"), - // }, - // 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), - // }, - // }}, - // 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{ - // }, - // 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"), - // }, - // SKU: &armnetwork.LoadBalancerSKU{ - // Name: to.Ptr(armnetwork.LoadBalancerSKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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"), - }, - }, - }}, - }, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go index 4bcfa4274433..7ca1ab885b89 100644 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to the create or update local network gateway operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *LocalNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *LocalNetworkGatewaysClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LocalNetworkGatewaysClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *LocalNetworkGatewaysClient) deleteOperation(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *LocalNetworkGatewaysClient) deleteCreateRequest(ctx context.Contex // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - options - LocalNetworkGatewaysClientGetOptions contains the optional parameters for the LocalNetworkGatewaysClient.Get @@ -233,7 +230,7 @@ func (client *LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, options *LocalNetworkGatewaysClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *LocalNetworkGatewaysClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *LocalNetworkGatewaysClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all the local network gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - LocalNetworkGatewaysClientListOptions contains the optional parameters for the LocalNetworkGatewaysClient.NewListPager // method. @@ -297,7 +294,7 @@ func (client *LocalNetworkGatewaysClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *LocalNetworkGatewaysClientListOptions) (*policy.Request, error) { +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") @@ -312,7 +309,7 @@ func (client *LocalNetworkGatewaysClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +327,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - localNetworkGatewayName - The name of the local network gateway. // - parameters - Parameters supplied to update local network gateway tags. @@ -359,7 +356,7 @@ 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, options *LocalNetworkGatewaysClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -378,7 +375,7 @@ func (client *LocalNetworkGatewaysClient) updateTagsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go deleted file mode 100644 index 0b84b0642d94..000000000000 --- a/sdk/resourcemanager/network/armnetwork/localnetworkgateways_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalNetworkGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "localgw", armnetwork.LocalNetworkGateway{ - Location: to.Ptr("Central US"), - Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - Fqdn: to.Ptr("site1.contoso.com"), - GatewayIPAddress: to.Ptr("11.12.13.14"), - LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - AddressPrefixes: []*string{ - to.Ptr("10.1.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 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.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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLocalNetworkGatewaysClient().BeginDelete(ctx, "rg1", "localgw", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocalNetworkGatewaysClient().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.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")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // { - // 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\""), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // GatewayIPAddress: to.Ptr("x.x.x.x"), - // LocalNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("10.2.0.0/16")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/management_client.go b/sdk/resourcemanager/network/armnetwork/management_client.go index e2532f6fc9cf..00121df26525 100644 --- a/sdk/resourcemanager/network/armnetwork/management_client.go +++ b/sdk/resourcemanager/network/armnetwork/management_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain 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 @@ -76,7 +73,7 @@ func (client *ManagementClient) CheckDNSNameAvailability(ctx context.Context, lo } // checkDNSNameAvailabilityCreateRequest creates the CheckDNSNameAvailability request. -func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx context.Context, location string, domainNameLabel string, options *ManagementClientCheckDNSNameAvailabilityOptions) (*policy.Request, error) { +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") @@ -91,7 +88,7 @@ func (client *ManagementClient) checkDNSNameAvailabilityCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("domainNameLabel", domainNameLabel) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -110,7 +107,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -137,7 +134,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -160,7 +157,7 @@ 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, options *ManagementClientBeginDeleteBastionShareableLinkOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -179,7 +176,7 @@ func (client *ManagementClient) deleteBastionShareableLinkCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -191,7 +188,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslTokenRequest - Post request for Delete Bastion Shareable Link By Token endpoint. @@ -218,7 +215,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -241,7 +238,7 @@ 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, options *ManagementClientBeginDeleteBastionShareableLinkByTokenOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -260,7 +257,7 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslTokenRequest); err != nil { @@ -271,7 +268,7 @@ func (client *ManagementClient) deleteBastionShareableLinkByTokenCreateRequest(c // NewDisconnectActiveSessionsPager - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - sessionIDs - The list of sessionids to disconnect. @@ -301,7 +298,7 @@ func (client *ManagementClient) NewDisconnectActiveSessionsPager(resourceGroupNa } // disconnectActiveSessionsCreateRequest creates the DisconnectActiveSessions request. -func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIDs SessionIDs, options *ManagementClientDisconnectActiveSessionsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -320,7 +317,7 @@ func (client *ManagementClient) disconnectActiveSessionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sessionIDs); err != nil { @@ -341,7 +338,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - providerport - The name of the provider port. // - options - ManagementClientExpressRouteProviderPortOptions contains the optional parameters for the ManagementClient.ExpressRouteProviderPort // method. @@ -368,7 +365,7 @@ func (client *ManagementClient) ExpressRouteProviderPort(ctx context.Context, pr } // expressRouteProviderPortCreateRequest creates the ExpressRouteProviderPort request. -func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx context.Context, providerport string, options *ManagementClientExpressRouteProviderPortOptions) (*policy.Request, error) { +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") @@ -383,7 +380,7 @@ func (client *ManagementClient) expressRouteProviderPortCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +399,7 @@ func (client *ManagementClient) expressRouteProviderPortHandleResponse(resp *htt // and associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. // - vpnClientParams - Parameters supplied to the generate VirtualWan VPN profile generation operation. @@ -430,7 +427,7 @@ func (client *ManagementClient) BeginGeneratevirtualwanvpnserverconfigurationvpn // associated VpnServerConfiguration combination in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -453,7 +450,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi } // generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest creates the Generatevirtualwanvpnserverconfigurationvpnprofile request. -func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofileCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVPNProfileParameters, options *ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions) (*policy.Request, error) { +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" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -472,7 +469,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnClientParams); err != nil { @@ -483,7 +480,7 @@ func (client *ManagementClient) generatevirtualwanvpnserverconfigurationvpnprofi // BeginGetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - options - ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions @@ -526,7 +523,7 @@ func (client *ManagementClient) BeginGetActiveSessions(ctx context.Context, reso // GetActiveSessions - Returns the list of currently active sessions on the Bastion. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*http.Response, error) { var err error const operationName = "ManagementClient.BeginGetActiveSessions" @@ -549,7 +546,7 @@ func (client *ManagementClient) getActiveSessions(ctx context.Context, resourceG } // getActiveSessionsCreateRequest creates the GetActiveSessions request. -func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, options *ManagementClientBeginGetActiveSessionsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -568,7 +565,7 @@ func (client *ManagementClient) getActiveSessionsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -585,7 +582,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -615,7 +612,7 @@ func (client *ManagementClient) NewGetBastionShareableLinkPager(resourceGroupNam } // getBastionShareableLinkCreateRequest creates the GetBastionShareableLink request. -func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest, options *ManagementClientGetBastionShareableLinkOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -634,7 +631,7 @@ func (client *ManagementClient) getBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -655,7 +652,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -706,7 +703,7 @@ func (client *ManagementClient) listActiveConnectivityConfigurationsCreateReques if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -727,7 +724,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Active Configuration Parameter. @@ -778,7 +775,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -800,7 +797,7 @@ func (client *ManagementClient) listActiveSecurityAdminRulesHandleResponse(resp // network. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -851,7 +848,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveConnectivityConfigura if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -872,7 +869,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to list correct page. @@ -923,7 +920,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesCre if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -943,7 +940,7 @@ func (client *ManagementClient) listNetworkManagerEffectiveSecurityAdminRulesHan // BeginPutBastionShareableLink - Creates a Bastion Shareable Links for all the VMs specified in the request. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - bastionHostName - The name of the Bastion Host. // - bslRequest - Post request for Create/Delete/Get Bastion Shareable Link endpoints. @@ -987,7 +984,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1010,7 +1007,7 @@ 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, options *ManagementClientBeginPutBastionShareableLinkOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1029,7 +1026,7 @@ func (client *ManagementClient) putBastionShareableLinkCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bslRequest); err != nil { @@ -1050,7 +1047,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN for which supported security providers are needed. // - options - ManagementClientSupportedSecurityProvidersOptions contains the optional parameters for the ManagementClient.SupportedSecurityProviders @@ -1078,7 +1075,7 @@ func (client *ManagementClient) SupportedSecurityProviders(ctx context.Context, } // supportedSecurityProvidersCreateRequest creates the SupportedSecurityProviders request. -func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *ManagementClientSupportedSecurityProvidersOptions) (*policy.Request, error) { +func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, _ *ManagementClientSupportedSecurityProvidersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1097,7 +1094,7 @@ func (client *ManagementClient) supportedSecurityProvidersCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 255d311e3f80..000000000000 --- a/sdk/resourcemanager/network/armnetwork/management_client_example_test.go +++ /dev/null @@ -1,654 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginDeleteBastionShareableLink(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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }}, - }, 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.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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagementClient().BeginGetActiveSessions(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) - } - 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.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), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementClient().NewDisconnectActiveSessionsPager("rg1", "bastionhosttenant", armnetwork.SessionIDs{}, 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveConnectivityConfigurationsOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // { - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - SkipToken: to.Ptr("fakeSkipTokenCode"), - }, &armnetwork.ManagementClientListActiveSecurityAdminRulesOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // 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), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // { - // 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), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // 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), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().SupportedSecurityProviders(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.VirtualWanSecurityProviders = armnetwork.VirtualWanSecurityProviders{ - // SupportedProviders: []*armnetwork.VirtualWanSecurityProvider{ - // { - // Name: to.Ptr("AzureFirewall"), - // Type: to.Ptr(armnetwork.VirtualWanSecurityProviderTypeNative), - // URL: to.Ptr(""), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - if 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"), - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go index 185997bf6e9e..5f7e3f6804c6 100644 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -44,7 +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 2024-05-01 +// Generated from API version 2024-07-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - parameters - Network manager connection to be created/updated. @@ -73,7 +70,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdate(ctx } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, options *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, parameters ManagerConnection, _ *ManagementGroupNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if managementGroupID == "" { return nil, errors.New("parameter managementGroupID cannot be empty") @@ -88,7 +85,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -109,7 +106,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 2024-05-01 +// Generated from API version 2024-07-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Delete @@ -136,7 +133,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) Delete(ctx context } // deleteCreateRequest creates the Delete request. -func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, _ *ManagementGroupNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if managementGroupID == "" { return nil, errors.New("parameter managementGroupID cannot be empty") @@ -151,7 +148,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +157,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) deleteCreateReques // Get - Get a specified connection created by this management group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - networkManagerConnectionName - Name for the network manager connection. // - options - ManagementGroupNetworkManagerConnectionsClientGetOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.Get @@ -188,7 +185,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) Get(ctx context.Co } // getCreateRequest creates the Get request. -func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, options *ManagementGroupNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { +func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, managementGroupID string, networkManagerConnectionName string, _ *ManagementGroupNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if managementGroupID == "" { return nil, errors.New("parameter managementGroupID cannot be empty") @@ -203,7 +200,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +217,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) getHandleResponse( // NewListPager - List all network manager connections created by this management group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - managementGroupID - The management group Id which uniquely identify the Microsoft Azure management group. // - options - ManagementGroupNetworkManagerConnectionsClientListOptions contains the optional parameters for the ManagementGroupNetworkManagerConnectionsClient.NewListPager // method. @@ -265,7 +262,7 @@ func (client *ManagementGroupNetworkManagerConnectionsClient) listCreateRequest( if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index dc6c7a50f088..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managementgroupnetworkmanagerconnections_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementGroupNetworkManagerConnectionsClient().Delete(ctx, "managementGroupA", "TestNMConnection", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementGroupNetworkManagerConnectionsClient().NewListPager("managementGroupA", &armnetwork.ManagementGroupNetworkManagerConnectionsClientListOptions{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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client.go b/sdk/resourcemanager/network/armnetwork/managercommits_client.go index 6f9a0a8ad754..81818c225395 100644 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client.go +++ b/sdk/resourcemanager/network/armnetwork/managercommits_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network commit is. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *ManagerCommitsClient) post(ctx context.Context, resourceGroupName } // postCreateRequest creates the Post request. -func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, options *ManagerCommitsClientBeginPostOptions) (*policy.Request, error) { +func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters ManagerCommit, _ *ManagerCommitsClientBeginPostOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *ManagerCommitsClient) postCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go deleted file mode 100644 index be3330894b57..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managercommits_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - TargetLocations: []*string{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // TargetLocations: []*string{ - // to.Ptr("useast")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go index 73935ee7e59e..0ef72a6ad53d 100644 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which Managed Network deployment status is. @@ -99,7 +96,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go deleted file mode 100644 index 4a38c058c70b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managerdeploymentstatus_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"))}, - Regions: []*string{ - to.Ptr("eastus"), - to.Ptr("westus")}, - SkipToken: to.Ptr("FakeSkipTokenCode"), - }, &armnetwork.ManagerDeploymentStatusClientListOptions{Top: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // DeploymentStatus: to.Ptr(armnetwork.DeploymentStatusDeploying), - // DeploymentType: to.Ptr(armnetwork.ConfigurationType("AdminPolicy")), - // ErrorMessage: to.Ptr(""), - // Region: to.Ptr("eastus"), - // }, - // { - // 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"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go index 81bfecf25e59..8a9d40fd2d1a 100644 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -78,7 +75,7 @@ func (client *ManagerRoutingConfigurationsClient) CreateOrUpdate(ctx context.Con } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagerRoutingConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, routingConfiguration ManagerRoutingConfiguration, options *ManagerRoutingConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagerRoutingConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, routingConfiguration ManagerRoutingConfiguration, _ *ManagerRoutingConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,7 +98,7 @@ func (client *ManagerRoutingConfigurationsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingConfiguration); err != nil { @@ -122,7 +119,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -149,7 +146,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -195,7 +192,7 @@ func (client *ManagerRoutingConfigurationsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +204,7 @@ func (client *ManagerRoutingConfigurationsClient) deleteCreateRequest(ctx contex // Get - Retrieves a network manager routing configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -236,7 +233,7 @@ func (client *ManagerRoutingConfigurationsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *ManagerRoutingConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *ManagerRoutingConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *ManagerRoutingConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, _ *ManagerRoutingConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -259,7 +256,7 @@ func (client *ManagerRoutingConfigurationsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +273,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -330,7 +327,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 0edcddfa0a62..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managerroutingconfigurations_client_example_test.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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/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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/managers_client.go b/sdk/resourcemanager/network/armnetwork/managers_client.go index 738791efab20..70639a8f9611 100644 --- a/sdk/resourcemanager/network/armnetwork/managers_client.go +++ b/sdk/resourcemanager/network/armnetwork/managers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. @@ -76,7 +73,7 @@ func (client *ManagersClient) CreateOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, options *ManagersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters Manager, _ *ManagersClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *ManagersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +113,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ManagersClientBeginDeleteOptions contains the optional parameters for the ManagersClient.BeginDelete method. @@ -141,7 +138,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ManagersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagersClient.BeginDelete" @@ -183,7 +180,7 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -195,7 +192,7 @@ func (client *ManagersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified Network Manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ManagersClientGetOptions contains the optional parameters for the ManagersClient.Get method. @@ -222,7 +219,7 @@ func (client *ManagersClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, options *ManagersClientGetOptions) (*policy.Request, error) { +func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, _ *ManagersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -241,7 +238,7 @@ func (client *ManagersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +255,7 @@ func (client *ManagersClient) getHandleResponse(resp *http.Response) (ManagersCl // NewListPager - List network managers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ManagersClientListOptions contains the optional parameters for the ManagersClient.NewListPager method. func (client *ManagersClient) NewListPager(resourceGroupName string, options *ManagersClientListOptions) *runtime.Pager[ManagersClientListResponse] { @@ -306,7 +303,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +320,7 @@ func (client *ManagersClient) listHandleResponse(resp *http.Response) (ManagersC // NewListBySubscriptionPager - List all network managers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ManagersClientListBySubscriptionOptions contains the optional parameters for the ManagersClient.NewListBySubscriptionPager // method. func (client *ManagersClient) NewListBySubscriptionPager(options *ManagersClientListBySubscriptionOptions) *runtime.Pager[ManagersClientListBySubscriptionResponse] { @@ -367,7 +364,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - parameters - Parameters supplied to specify which network manager is. @@ -413,7 +410,7 @@ func (client *ManagersClient) Patch(ctx context.Context, resourceGroupName strin } // patchCreateRequest creates the Patch request. -func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, options *ManagersClientPatchOptions) (*policy.Request, error) { +func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, parameters PatchObject, _ *ManagersClientPatchOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -432,7 +429,7 @@ func (client *ManagersClient) patchCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go deleted file mode 100644 index eba3ec2e07ba..000000000000 --- a/sdk/resourcemanager/network/armnetwork/managers_client_example_test.go +++ /dev/null @@ -1,316 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagersClient().CreateOrUpdate(ctx, "rg1", "TestNetworkManager", armnetwork.Manager{ - 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/testmg")}, - Subscriptions: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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)}, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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)}, - // 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: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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagersClient().NewListBySubscriptionPager(&armnetwork.ManagersClientListBySubscriptionOptions{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.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)}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagersClient().NewListPager("rg1", &armnetwork.ManagersClientListOptions{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.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)}, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/models.go b/sdk/resourcemanager/network/armnetwork/models.go index 82906f6aa2af..ca6da201285e 100644 --- a/sdk/resourcemanager/network/armnetwork/models.go +++ b/sdk/resourcemanager/network/armnetwork/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -347,6 +344,21 @@ type AdminRuleListResult struct { Value []BaseAdminRuleClassification } +// AdvertisedPublicPrefixProperties - Prefix properties required to perform validation using openssl signature. +type AdvertisedPublicPrefixProperties struct { + // Advertised Public Prefix. + Prefix *string + + // Signed string generated by encrypting validationId with a private key. + Signature *string + + // Validation string that contains circuit peering info. + ValidationID *string + + // READ-ONLY; Advertised Public Prefix State that denotes if the prefix is validated or not. + ValidationState *AdvertisedPublicPrefixPropertiesValidationState +} + // ApplicationGateway - Application gateway resource. type ApplicationGateway struct { // Resource ID. @@ -3287,6 +3299,17 @@ type ChildResource struct { Type *string } +type CircuitMetadataMap struct { + // Link to the Express Route circuit + Link *string + + // Peering location of the Express Route Circuit + Location *string + + // Express Route Circuit Name + Name *string +} + // CommonErrorAdditionalInfo - The resource management error additional info. type CommonErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -3876,6 +3899,9 @@ type ConnectivityConfigurationProperties struct { // REQUIRED; Connectivity topology type. ConnectivityTopology *ConnectivityTopology + // Collection of additional settings to enhance specific topology behaviors of the connectivity configuration resource. + ConnectivityCapabilities *ConnectivityConfigurationPropertiesConnectivityCapabilities + // Flag if need to remove current existing peerings. DeleteExistingPeering *DeleteExistingPeering @@ -3895,6 +3921,19 @@ type ConnectivityConfigurationProperties struct { ResourceGUID *string } +// ConnectivityConfigurationPropertiesConnectivityCapabilities - Collection of additional settings to enhance specific topology +// behaviors of the connectivity configuration resource. +type ConnectivityConfigurationPropertiesConnectivityCapabilities struct { + // REQUIRED; Behavior to handle overlapped IP address space among members of the connected group of the connectivity configuration. + ConnectedGroupAddressOverlap *ConnectedGroupAddressOverlap + + // REQUIRED; Option indicating the scale of private endpoints allowed in the connected group of the connectivity configuration. + ConnectedGroupPrivateEndpointScale *ConnectedGroupPrivateEndpointScale + + // REQUIRED; Option indicating enforcement of peerings created by the connectivity configuration. + PeeringEnforcement *PeeringEnforcement +} + // ConnectivityDestination - Parameters that define destination of connection. type ConnectivityDestination struct { // The IP address or URI the resource to which a connection attempt will be made. @@ -4851,6 +4890,33 @@ type Error struct { Target *string } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ErrorDetails - Common error details representation. type ErrorDetails struct { // Error code. @@ -5097,6 +5163,9 @@ type ExpressRouteCircuitPeeringConfig struct { // The communities of bgp peering. Specified for microsoft peering. AdvertisedCommunities []*string + // List of Prefix information required to perform validation. + AdvertisedPublicPrefixInfo []*AdvertisedPublicPrefixProperties + // The reference to AdvertisedPublicPrefixes. AdvertisedPublicPrefixes []*string @@ -6804,6 +6873,51 @@ type GatewayLoadBalancerTunnelInterface struct { Type *GatewayLoadBalancerTunnelInterfaceType } +// GatewayResiliencyInformation - Gateway Resiliency Information +type GatewayResiliencyInformation struct { + // List of Resiliency based Recommendation Components for the gateway + Components []*ResiliencyRecommendationComponents + + // Timestamp denoting the last time when the resiliency score was computed for the gateway + LastComputedTime *string + + // Maximum increase expected in the score if all of the recommendations are applied for the gateway + MaxScoreFromRecommendations *string + + // Minimum increase expected in the score if the at least one of the recommendations is applied for the gateway + MinScoreFromRecommendations *string + + // Timestamp denoting the next eligible time to re-compute the resiliency score for the gateway + NextEligibleComputeTime *string + + // Current Resiliency Score for the gateway + OverallScore *string + + // Update in the Resiliency Score for the gateway from the last computed score + ScoreChange *string +} + +// GatewayResiliencyRecommendation - Resiliency Recommendation details +type GatewayResiliencyRecommendation struct { + // Link to the public documentation for the associated recommendation + CallToActionLink *string + + // Acton items to apply the recommendation + CallToActionText *string + + // Recommendation Id + RecommendationID *string + + // Recommendation details + RecommendationText *string + + // Recommendation Title + RecommendationTitle *string + + // Impact associated with the recommendation + Severity *string +} + // GatewayRoute - Gateway routing details. type GatewayRoute struct { // READ-ONLY; The route's AS path sequence. @@ -6834,6 +6948,35 @@ type GatewayRouteListResult struct { Value []*GatewayRoute } +type GatewayRouteSet struct { + // List of different Route Sources + Details map[string][]*RouteSourceDetails + + // List of different locations from where the routes are learned + Locations []*string + + // Route Set name + Name *string +} + +// GatewayRouteSetsInformation - Gateway Route Sets Information +type GatewayRouteSetsInformation struct { + // Dictionary containing map of the circuit id and circuit details + CircuitsMetadataMap map[string]*CircuitMetadataMap + + // Timestamp denoting the last time when the route sets were computed for the gateway + LastComputedTime *string + + // Timestamp denoting the next eligible time to re-compute the route sets for the gateway + NextEligibleComputeTime *string + + // Version for the route set + RouteSetVersion *string + + // List of Gateway Route Sets + RouteSets []*GatewayRouteSet +} + // GenerateExpressRoutePortsLOARequest - The customer name to be printed on a letter of authorization. type GenerateExpressRoutePortsLOARequest struct { // REQUIRED; The customer name. @@ -7995,6 +8138,9 @@ type IpamPool struct { // Resource tags. Tags map[string]*string + // READ-ONLY; String representing unique etag for the resource document. + Etag *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -8349,8 +8495,8 @@ type LoadBalancerHealthPerRulePerBackendAddress struct { // The IP address belonging to the backend address. IPAddress *string - // The id of the network interface ip configuration belonging to the backend address - NetworkInterfaceIPConfigurationID *InterfaceIPConfiguration + // Resource ID of the Network Interface IP Configuration. + NetworkInterfaceIPConfigurationID *string // The explanation of the State Reason *string @@ -8506,6 +8652,10 @@ type LoadBalancingRulePropertiesFormat struct { // rule. DisableOutboundSnat *bool + // Defines whether connections between 2 communicating endpoints can be tracked and associated to the same backend VM over + // its lifetime when using UDP protocol. + 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. @@ -8632,6 +8782,18 @@ type ManagedRuleSet struct { // Defines the rule group overrides to apply to the rule set. RuleGroupOverrides []*ManagedRuleGroupOverride + + // READ-ONLY; Stores the final list of disabled rule groups + ComputedDisabledRules []*ManagedRuleSetRuleGroup +} + +// ManagedRuleSetRuleGroup - Defines a managed rule set rule group +type ManagedRuleSetRuleGroup struct { + // REQUIRED; Name of the rule group + RuleGroupName *string + + // List of rules within the rule group + Rules []*string } // ManagedRulesDefinition - Allow to exclude some variable satisfy the condition for the WAF check. @@ -9155,6 +9317,329 @@ type NextHopResult struct { RouteTableID *string } +// NspAccessRule - The NSP access rule resource +type NspAccessRule struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the NSP access rule. + Properties *NspAccessRuleProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + 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. +type NspAccessRuleListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP access rule + Value []*NspAccessRule +} + +// NspAccessRuleProperties - Properties of NSP access rule. +type NspAccessRuleProperties struct { + // Inbound address prefixes (IPv4/IPv6) + AddressPrefixes []*string + + // Direction that specifies whether the access rules is inbound/outbound. + Direction *AccessRuleDirection + + // Outbound rules email address format. + EmailAddresses []*string + + // Outbound rules fully qualified domain name format. + FullyQualifiedDomainNames []*string + + // Outbound rules phone number format. + PhoneNumbers []*string + + // Inbound rules service tag names. + ServiceTags []*string + + // List of subscription ids + Subscriptions []*SubscriptionID + + // READ-ONLY; Rule specified by the perimeter id. + NetworkSecurityPerimeters []*PerimeterBasedAccessRule + + // READ-ONLY; The provisioning state of the scope assignment resource. + ProvisioningState *NspProvisioningState +} + +// NspAssociation - The NSP resource association resource +type NspAssociation struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the NSP resource association. + Properties *NspAssociationProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +type NspAssociationProperties struct { + // Access mode on the association. + AccessMode *AssociationAccessMode + + // The PaaS resource to be associated. + PrivateLinkResource *SubResource + + // Profile id to which the PaaS resource is associated. + Profile *SubResource + + // READ-ONLY; Specifies if there are provisioning issues + HasProvisioningIssues *string + + // READ-ONLY; The provisioning state of the resource association resource. + 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. +type NspAssociationsListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP resource associations + Value []*NspAssociation +} + +// NspLink - The network security perimeter link resource +type NspLink struct { + // Properties of the network security perimeter link resource. + Properties *NspLinkProperties + + // 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 +} + +// 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. +type NspLinkListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP Link resources. + Value []*NspLink +} + +// 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. + AutoApprovedRemotePerimeterResourceID *string + + // A message passed to the owner of the remote NSP link resource with this connection request. In case of Auto-approved flow, + // it is default to 'Auto Approved'. Restricted to 140 chars. + Description *string + + // Local Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. + LocalInboundProfiles []*string + + // Remote Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. This property can + // only be updated in auto-approval mode. + 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. + 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. + RemoteOutboundProfiles []*string + + // READ-ONLY; Remote NSP Guid with which the link gets created. + RemotePerimeterGUID *string + + // READ-ONLY; Remote NSP location with which the link gets created. + RemotePerimeterLocation *string + + // READ-ONLY; The NSP link state. + Status *NspLinkStatus +} + +// NspLinkReference - The network security perimeter linkReference resource +type NspLinkReference struct { + // Properties of the network security perimeter linkReference resource. + Properties *NspLinkReferenceProperties + + // 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 +} + +// 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. +type NspLinkReferenceListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP LinkReference resources. + Value []*NspLinkReference +} + +// NspLinkReferenceProperties - Properties of NSP LinkReference resource. +type NspLinkReferenceProperties struct { + // Local Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. + LocalInboundProfiles []*string + + // The NSP linkReference state. It cannot be changed if link is created in auto-approval mode. + Status *NspLinkStatus + + // READ-ONLY; A message sent by the remote NSP link admin for connection request. In case of Auto-approved flow, it is default + // to 'Auto Approved'. + 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. + 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. + 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. + RemoteOutboundProfiles []*string + + // READ-ONLY; Remote NSP Guid with which the link is created. + RemotePerimeterGUID *string + + // READ-ONLY; Remote NSP location with which the link gets created. + RemotePerimeterLocation *string + + // READ-ONLY; Perimeter ARM Id for the remote NSP with which the link is created. + RemotePerimeterResourceID *string +} + +// NspLoggingConfiguration - The NSP logging configuration +type NspLoggingConfiguration struct { + // Properties of the NSP logging configuration. + Properties *NspLoggingConfigurationProperties + + // 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 +} + +// 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. +type NspLoggingConfigurationListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP logging configuration + Value []*NspLoggingConfiguration +} + +// NspLoggingConfigurationProperties - The NSP logging configuration properties. +type NspLoggingConfigurationProperties struct { + // The log categories to enable in the NSP logging configuration. + EnabledLogCategories []*string + + // The version of the NSP logging configuration. + Version *string +} + +// NspProfile - The network security perimeter profile resource +type NspProfile struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the network security perimeter profile + Properties *NspProfileProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + 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. +type NspProfileListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NSP profile + Value []*NspProfile +} + +// NspProfileProperties - Properties of NSP profile. +type NspProfileProperties struct { + // READ-ONLY; Version number that increases with every update to access rules within the profile. + AccessRulesVersion *string + + // READ-ONLY; Version number that increases with every update to diagnostic settings within the profile. + DiagnosticSettingsVersion *string +} + // O365BreakOutCategoryPolicies - Office365 breakout categories. type O365BreakOutCategoryPolicies struct { // Flag to control allow category. @@ -9234,6 +9719,36 @@ type OperationPropertiesFormatServiceSpecification struct { MetricSpecifications []*MetricSpecification } +// OperationStatusResult - The current status of an async operation. +type OperationStatusResult struct { + // REQUIRED; Operation status. + Status *string + + // The end time of the operation. + EndTime *time.Time + + // If present, details of the operation error. + Error *ErrorDetail + + // Fully qualified ID for the async operation. + ID *string + + // Name of the async operation. + Name *string + + // The operations list. + Operations []*OperationStatusResult + + // Percent of the operation that is complete. + PercentComplete *float32 + + // The start time of the operation. + StartTime *time.Time + + // READ-ONLY; Fully qualified ID of the resource against which the original async operation was started. + ResourceID *string +} + // OrderBy - Describes a column to sort type OrderBy struct { // Describes the actual column name to sort by @@ -9749,6 +10264,60 @@ type PeerRoute struct { Weight *int32 } +// PerimeterAssociableResource - Resource that is onboarded to use network security perimeter. Also referred as perimeter +// associable resource. +type PerimeterAssociableResource struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // Properties of the perimeter associable resource. + Properties *PerimeterAssociableResourceProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// PerimeterAssociableResourceProperties - Properties of the perimeter associable resources. +type PerimeterAssociableResourceProperties struct { + // READ-ONLY; A friendly name for the properties of perimeter associable resources. + DisplayName *string + + // READ-ONLY; Public DNS zone names of the resources. + PublicDNSZones []*string + + // READ-ONLY; Resource type/provider name. + ResourceType *string +} + +// PerimeterAssociableResourcesListResult - Paged list of perimeter associable resources. +type PerimeterAssociableResourcesListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets paged list of perimeter associable resources. + Value []*PerimeterAssociableResource +} + +type PerimeterBasedAccessRule struct { + // READ-ONLY; NSP id in the ARM id format. + ID *string + + // READ-ONLY; Location of the NSP supplied. + Location *string + + // READ-ONLY; Resource guid of the NSP supplied. + PerimeterGUID *string +} + // PolicySettings - Defines contents of a web application firewall global configuration. type PolicySettings struct { // If the action type is block, customer can override the response body. The body must be specified in base64 encoding. @@ -10361,6 +10930,21 @@ 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. @@ -10783,6 +11367,21 @@ type ReferencedPublicIPAddress struct { ID *string } +// ResiliencyRecommendationComponents - Gateway Resiliency based Recommendations +type ResiliencyRecommendationComponents struct { + // Current Score of the gateway + CurrentScore *string + + // Max score that the gateway can achieve if the specified recommendation is applied + MaxScore *string + + // Name of the Resiliency based Recommendation Component + Name *string + + // List of Gateway Resiliency based Recommendations + Recommendations []*GatewayResiliencyRecommendation +} + // Resource - Common resource representation. type Resource struct { // Resource ID. @@ -11047,6 +11646,17 @@ type RoutePropertiesFormat struct { ProvisioningState *ProvisioningState } +type RouteSourceDetails struct { + // Express Route Circuit identifier + Circuit *string + + // Flag to indicate if the route learned from the primary device is active or passive + Pri *string + + // Flag to indicate if the route learned from the secondary device is active or passive + Sec *string +} + // RouteTable - Route table resource. type RouteTable struct { // Resource ID. @@ -11549,6 +12159,46 @@ type SecurityPartnerProviderPropertiesFormat struct { ProvisioningState *ProvisioningState } +// SecurityPerimeter - The Network Security Perimeter resource +type SecurityPerimeter struct { + // Resource ID. + ID *string + + // Resource location. + Location *string + + // The network security perimeter properties + Properties *SecurityPerimeterProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + 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. +type SecurityPerimeterListResult struct { + // Gets the URL to get the next page of results. + NextLink *string + + // Gets a page of NetworkSecurityPerimeter + Value []*SecurityPerimeter +} + +// SecurityPerimeterProperties - Properties of network security perimeter. +type SecurityPerimeterProperties struct { + // READ-ONLY; perimeter guid of the network security perimeter. + PerimeterGUID *string + + // READ-ONLY; The provisioning state of the scope assignment resource. + ProvisioningState *NspProvisioningState +} + // SecurityRule - Network security rule. type SecurityRule struct { // Resource ID. @@ -12377,6 +13027,11 @@ type SubnetPropertiesFormat struct { ServiceAssociationLinks []*ServiceAssociationLink } +type SubscriptionID struct { + // Subscription id in the ARM id format. + ID *string +} + // SwapResource to represent slot type on the specified cloud service. type SwapResource struct { // Swap resource properties @@ -12607,6 +13262,15 @@ type UnprepareNetworkPoliciesRequest struct { ServiceName *string } +// UpdateTagsRequest - Update tags request. +type UpdateTagsRequest struct { + // List of tags for Network Security Perimeter + Tags map[string]*string + + // READ-ONLY; Network security perimeter identifier. + ID *string +} + // Usage - The network resource usage. type Usage struct { // REQUIRED; The current value of the usage. @@ -13524,6 +14188,9 @@ type VerifierWorkspace struct { // Resource tags. Tags map[string]*string + // READ-ONLY; String representing unique etag for the resource document. + Etag *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -13604,6 +14271,19 @@ type VirtualApplianceAdditionalNicProperties struct { Name *string } +// VirtualApplianceBootDiagnosticParameters - Specifies input parameters required to retrieve the boot diagnostic logs for +// an NVA instance +type VirtualApplianceBootDiagnosticParameters struct { + // Specifies the sas-url to the storage blob into which console screen shot for the requested instance will be written + ConsoleScreenshotStorageSasURL *string + + // The network virtual appliance instance id for which boot diagnostic logs is being requested + InstanceID *int32 + + // Specifies the sas-url to the storage blob into which serial console logs for the requested instance will be written + SerialConsoleStorageSasURL *string +} + // VirtualApplianceConnection - NetworkVirtualApplianceConnection resource. type VirtualApplianceConnection struct { // Resource ID. @@ -13664,6 +14344,11 @@ type VirtualApplianceIPConfigurationProperties struct { Primary *bool } +type VirtualApplianceInstanceID struct { + // The network virtual appliance instance id for which boot diagnostic logs is being requested + InstanceID *int32 +} + // 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 @@ -14440,6 +15125,27 @@ type VirtualNetworkGatewayListResult struct { NextLink *string } +// VirtualNetworkGatewayMigrationParameters - Virtual network gateway migration parameters. +type VirtualNetworkGatewayMigrationParameters struct { + // REQUIRED; MigrationType for the virtual network gateway. + MigrationType *VirtualNetworkGatewayMigrationType + + // The reference to the public IP resource. + ResourceURL *SubResource +} + +// VirtualNetworkGatewayMigrationStatus - Migration status for the Virtual Network Gateway. +type VirtualNetworkGatewayMigrationStatus struct { + // Error if any occurs during migration. + ErrorMessage *string + + // Represent the current migration phase of gateway. + Phase *VirtualNetworkGatewayMigrationPhase + + // Represent the current state of gateway migration. + State *VirtualNetworkGatewayMigrationState +} + // VirtualNetworkGatewayNatRule Resource. type VirtualNetworkGatewayNatRule struct { // Resource ID. @@ -14562,6 +15268,9 @@ type VirtualNetworkGatewayPropertiesFormat struct { // Whether dns forwarding is enabled or not. EnableDNSForwarding *bool + // Flag for enabling creation of high bandwidth VPN gateway + EnableHighBandwidthVPNGateway *bool + // Whether private IP needs to be enabled on this gateway for connections or not. EnablePrivateIPAddress *bool @@ -14596,6 +15305,9 @@ type VirtualNetworkGatewayPropertiesFormat struct { // The type of this virtual network gateway. VPNType *VPNType + // The reference to the VirtualNetworkGatewayMigrationStatus which represents the status of migration. + VirtualNetworkGatewayMigrationStatus *VirtualNetworkGatewayMigrationStatus + // The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available VirtualNetworkGatewayPolicyGroup // for the gateway. VirtualNetworkGatewayPolicyGroups []*VirtualNetworkGatewayPolicyGroup diff --git a/sdk/resourcemanager/network/armnetwork/models_serde.go b/sdk/resourcemanager/network/armnetwork/models_serde.go index f9540543c654..adb81f6e68a8 100644 --- a/sdk/resourcemanager/network/armnetwork/models_serde.go +++ b/sdk/resourcemanager/network/armnetwork/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -718,6 +715,45 @@ func (a *AdminRuleListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdvertisedPublicPrefixProperties. +func (a AdvertisedPublicPrefixProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "prefix", a.Prefix) + populate(objectMap, "signature", a.Signature) + populate(objectMap, "validationId", a.ValidationID) + populate(objectMap, "validationState", a.ValidationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvertisedPublicPrefixProperties. +func (a *AdvertisedPublicPrefixProperties) 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 "prefix": + err = unpopulate(val, "Prefix", &a.Prefix) + delete(rawMsg, key) + case "signature": + err = unpopulate(val, "Signature", &a.Signature) + delete(rawMsg, key) + case "validationId": + err = unpopulate(val, "ValidationID", &a.ValidationID) + delete(rawMsg, key) + case "validationState": + err = unpopulate(val, "ValidationState", &a.ValidationState) + 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) @@ -7998,6 +8034,41 @@ func (c *ChildResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CircuitMetadataMap. +func (c CircuitMetadataMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "link", c.Link) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CircuitMetadataMap. +func (c *CircuitMetadataMap) 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 "link": + err = unpopulate(val, "Link", &c.Link) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 CommonErrorAdditionalInfo. func (c CommonErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9541,6 +9612,7 @@ func (c *ConnectivityConfigurationListResult) UnmarshalJSON(data []byte) error { func (c ConnectivityConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "appliesToGroups", c.AppliesToGroups) + populate(objectMap, "connectivityCapabilities", c.ConnectivityCapabilities) populate(objectMap, "connectivityTopology", c.ConnectivityTopology) populate(objectMap, "deleteExistingPeering", c.DeleteExistingPeering) populate(objectMap, "description", c.Description) @@ -9563,6 +9635,9 @@ func (c *ConnectivityConfigurationProperties) UnmarshalJSON(data []byte) error { case "appliesToGroups": err = unpopulate(val, "AppliesToGroups", &c.AppliesToGroups) delete(rawMsg, key) + case "connectivityCapabilities": + err = unpopulate(val, "ConnectivityCapabilities", &c.ConnectivityCapabilities) + delete(rawMsg, key) case "connectivityTopology": err = unpopulate(val, "ConnectivityTopology", &c.ConnectivityTopology) delete(rawMsg, key) @@ -9592,6 +9667,41 @@ func (c *ConnectivityConfigurationProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConnectivityConfigurationPropertiesConnectivityCapabilities. +func (c ConnectivityConfigurationPropertiesConnectivityCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectedGroupAddressOverlap", c.ConnectedGroupAddressOverlap) + populate(objectMap, "connectedGroupPrivateEndpointScale", c.ConnectedGroupPrivateEndpointScale) + populate(objectMap, "peeringEnforcement", c.PeeringEnforcement) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityConfigurationPropertiesConnectivityCapabilities. +func (c *ConnectivityConfigurationPropertiesConnectivityCapabilities) 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 "connectedGroupAddressOverlap": + err = unpopulate(val, "ConnectedGroupAddressOverlap", &c.ConnectedGroupAddressOverlap) + delete(rawMsg, key) + case "connectedGroupPrivateEndpointScale": + err = unpopulate(val, "ConnectedGroupPrivateEndpointScale", &c.ConnectedGroupPrivateEndpointScale) + delete(rawMsg, key) + case "peeringEnforcement": + err = unpopulate(val, "PeeringEnforcement", &c.PeeringEnforcement) + 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 ConnectivityDestination. func (c ConnectivityDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11845,6 +11955,80 @@ func (e *Error) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + 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 ErrorDetails. func (e ErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12473,6 +12657,7 @@ func (e *ExpressRouteCircuitPeering) UnmarshalJSON(data []byte) error { func (e ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "advertisedCommunities", e.AdvertisedCommunities) + populate(objectMap, "advertisedPublicPrefixInfo", e.AdvertisedPublicPrefixInfo) populate(objectMap, "advertisedPublicPrefixes", e.AdvertisedPublicPrefixes) populate(objectMap, "advertisedPublicPrefixesState", e.AdvertisedPublicPrefixesState) populate(objectMap, "customerASN", e.CustomerASN) @@ -12493,6 +12678,9 @@ func (e *ExpressRouteCircuitPeeringConfig) UnmarshalJSON(data []byte) error { case "advertisedCommunities": err = unpopulate(val, "AdvertisedCommunities", &e.AdvertisedCommunities) delete(rawMsg, key) + case "advertisedPublicPrefixInfo": + err = unpopulate(val, "AdvertisedPublicPrefixInfo", &e.AdvertisedPublicPrefixInfo) + delete(rawMsg, key) case "advertisedPublicPrefixes": err = unpopulate(val, "AdvertisedPublicPrefixes", &e.AdvertisedPublicPrefixes) delete(rawMsg, key) @@ -16681,6 +16869,104 @@ func (g *GatewayLoadBalancerTunnelInterface) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayResiliencyInformation. +func (g GatewayResiliencyInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "components", g.Components) + populate(objectMap, "lastComputedTime", g.LastComputedTime) + populate(objectMap, "maxScoreFromRecommendations", g.MaxScoreFromRecommendations) + populate(objectMap, "minScoreFromRecommendations", g.MinScoreFromRecommendations) + populate(objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) + populate(objectMap, "overallScore", g.OverallScore) + populate(objectMap, "scoreChange", g.ScoreChange) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResiliencyInformation. +func (g *GatewayResiliencyInformation) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "components": + err = unpopulate(val, "Components", &g.Components) + delete(rawMsg, key) + case "lastComputedTime": + err = unpopulate(val, "LastComputedTime", &g.LastComputedTime) + delete(rawMsg, key) + case "maxScoreFromRecommendations": + err = unpopulate(val, "MaxScoreFromRecommendations", &g.MaxScoreFromRecommendations) + delete(rawMsg, key) + case "minScoreFromRecommendations": + err = unpopulate(val, "MinScoreFromRecommendations", &g.MinScoreFromRecommendations) + delete(rawMsg, key) + case "nextEligibleComputeTime": + err = unpopulate(val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) + delete(rawMsg, key) + case "overallScore": + err = unpopulate(val, "OverallScore", &g.OverallScore) + delete(rawMsg, key) + case "scoreChange": + err = unpopulate(val, "ScoreChange", &g.ScoreChange) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResiliencyRecommendation. +func (g GatewayResiliencyRecommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "callToActionLink", g.CallToActionLink) + populate(objectMap, "callToActionText", g.CallToActionText) + populate(objectMap, "recommendationId", g.RecommendationID) + populate(objectMap, "recommendationText", g.RecommendationText) + populate(objectMap, "recommendationTitle", g.RecommendationTitle) + populate(objectMap, "severity", g.Severity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResiliencyRecommendation. +func (g *GatewayResiliencyRecommendation) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "callToActionLink": + err = unpopulate(val, "CallToActionLink", &g.CallToActionLink) + delete(rawMsg, key) + case "callToActionText": + err = unpopulate(val, "CallToActionText", &g.CallToActionText) + delete(rawMsg, key) + case "recommendationId": + err = unpopulate(val, "RecommendationID", &g.RecommendationID) + delete(rawMsg, key) + case "recommendationText": + err = unpopulate(val, "RecommendationText", &g.RecommendationText) + delete(rawMsg, key) + case "recommendationTitle": + err = unpopulate(val, "RecommendationTitle", &g.RecommendationTitle) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &g.Severity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GatewayRoute. func (g GatewayRoute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -16759,15 +17045,17 @@ func (g *GatewayRouteListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOARequest. -func (g GenerateExpressRoutePortsLOARequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteSet. +func (g GatewayRouteSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customerName", g.CustomerName) + populate(objectMap, "details", g.Details) + populate(objectMap, "locations", g.Locations) + populate(objectMap, "name", g.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOARequest. -func (g *GenerateExpressRoutePortsLOARequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteSet. +func (g *GatewayRouteSet) 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", g, err) @@ -16775,8 +17063,14 @@ func (g *GenerateExpressRoutePortsLOARequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "customerName": - err = unpopulate(val, "CustomerName", &g.CustomerName) + case "details": + err = unpopulate(val, "Details", &g.Details) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &g.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) } if err != nil { @@ -16786,15 +17080,19 @@ func (g *GenerateExpressRoutePortsLOARequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOAResult. -func (g GenerateExpressRoutePortsLOAResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteSetsInformation. +func (g GatewayRouteSetsInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "encodedContent", g.EncodedContent) + populate(objectMap, "circuitsMetadataMap", g.CircuitsMetadataMap) + populate(objectMap, "lastComputedTime", g.LastComputedTime) + populate(objectMap, "nextEligibleComputeTime", g.NextEligibleComputeTime) + populate(objectMap, "routeSetVersion", g.RouteSetVersion) + populate(objectMap, "routeSets", g.RouteSets) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOAResult. -func (g *GenerateExpressRoutePortsLOAResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteSetsInformation. +func (g *GatewayRouteSetsInformation) 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", g, err) @@ -16802,8 +17100,20 @@ func (g *GenerateExpressRoutePortsLOAResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "encodedContent": - err = unpopulate(val, "EncodedContent", &g.EncodedContent) + case "circuitsMetadataMap": + err = unpopulate(val, "CircuitsMetadataMap", &g.CircuitsMetadataMap) + delete(rawMsg, key) + case "lastComputedTime": + err = unpopulate(val, "LastComputedTime", &g.LastComputedTime) + delete(rawMsg, key) + case "nextEligibleComputeTime": + err = unpopulate(val, "NextEligibleComputeTime", &g.NextEligibleComputeTime) + delete(rawMsg, key) + case "routeSetVersion": + err = unpopulate(val, "RouteSetVersion", &g.RouteSetVersion) + delete(rawMsg, key) + case "routeSets": + err = unpopulate(val, "RouteSets", &g.RouteSets) delete(rawMsg, key) } if err != nil { @@ -16813,16 +17123,15 @@ func (g *GenerateExpressRoutePortsLOAResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GetInboundRoutesParameters. -func (g GetInboundRoutesParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOARequest. +func (g GenerateExpressRoutePortsLOARequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionType", g.ConnectionType) - populate(objectMap, "resourceUri", g.ResourceURI) + populate(objectMap, "customerName", g.CustomerName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetInboundRoutesParameters. -func (g *GetInboundRoutesParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOARequest. +func (g *GenerateExpressRoutePortsLOARequest) 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", g, err) @@ -16830,11 +17139,35 @@ func (g *GetInboundRoutesParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "connectionType": - err = unpopulate(val, "ConnectionType", &g.ConnectionType) + case "customerName": + err = unpopulate(val, "CustomerName", &g.CustomerName) delete(rawMsg, key) - case "resourceUri": - err = unpopulate(val, "ResourceURI", &g.ResourceURI) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenerateExpressRoutePortsLOAResult. +func (g GenerateExpressRoutePortsLOAResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encodedContent", g.EncodedContent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateExpressRoutePortsLOAResult. +func (g *GenerateExpressRoutePortsLOAResult) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encodedContent": + err = unpopulate(val, "EncodedContent", &g.EncodedContent) delete(rawMsg, key) } if err != nil { @@ -16844,16 +17177,47 @@ func (g *GetInboundRoutesParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GetOutboundRoutesParameters. -func (g GetOutboundRoutesParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetInboundRoutesParameters. +func (g GetInboundRoutesParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "connectionType", g.ConnectionType) populate(objectMap, "resourceUri", g.ResourceURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetOutboundRoutesParameters. -func (g *GetOutboundRoutesParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetInboundRoutesParameters. +func (g *GetInboundRoutesParameters) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionType": + err = unpopulate(val, "ConnectionType", &g.ConnectionType) + delete(rawMsg, key) + case "resourceUri": + err = unpopulate(val, "ResourceURI", &g.ResourceURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetOutboundRoutesParameters. +func (g GetOutboundRoutesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionType", g.ConnectionType) + populate(objectMap, "resourceUri", g.ResourceURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetOutboundRoutesParameters. +func (g *GetOutboundRoutesParameters) 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", g, err) @@ -19603,6 +19967,7 @@ func (i *InternetIngressPublicIPsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IpamPool. func (i IpamPool) 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) @@ -19622,6 +19987,9 @@ func (i *IpamPool) UnmarshalJSON(data []byte) error { 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) @@ -21068,6 +21436,7 @@ func (l LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "backendAddressPools", l.BackendAddressPools) populate(objectMap, "backendPort", l.BackendPort) populate(objectMap, "disableOutboundSnat", l.DisableOutboundSnat) + populate(objectMap, "enableConnectionTracking", l.EnableConnectionTracking) populate(objectMap, "enableFloatingIP", l.EnableFloatingIP) populate(objectMap, "enableTcpReset", l.EnableTCPReset) populate(objectMap, "frontendIPConfiguration", l.FrontendIPConfiguration) @@ -21101,6 +21470,9 @@ func (l *LoadBalancingRulePropertiesFormat) UnmarshalJSON(data []byte) error { case "disableOutboundSnat": err = unpopulate(val, "DisableOutboundSnat", &l.DisableOutboundSnat) delete(rawMsg, key) + case "enableConnectionTracking": + err = unpopulate(val, "EnableConnectionTracking", &l.EnableConnectionTracking) + delete(rawMsg, key) case "enableFloatingIP": err = unpopulate(val, "EnableFloatingIP", &l.EnableFloatingIP) delete(rawMsg, key) @@ -21373,6 +21745,7 @@ func (m *ManagedRuleOverride) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedRuleSet. func (m ManagedRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "computedDisabledRules", m.ComputedDisabledRules) populate(objectMap, "ruleGroupOverrides", m.RuleGroupOverrides) populate(objectMap, "ruleSetType", m.RuleSetType) populate(objectMap, "ruleSetVersion", m.RuleSetVersion) @@ -21388,6 +21761,9 @@ func (m *ManagedRuleSet) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "computedDisabledRules": + err = unpopulate(val, "ComputedDisabledRules", &m.ComputedDisabledRules) + delete(rawMsg, key) case "ruleGroupOverrides": err = unpopulate(val, "RuleGroupOverrides", &m.RuleGroupOverrides) delete(rawMsg, key) @@ -21405,6 +21781,37 @@ func (m *ManagedRuleSet) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetRuleGroup. +func (m ManagedRuleSetRuleGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ruleGroupName", m.RuleGroupName) + populate(objectMap, "rules", m.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSetRuleGroup. +func (m *ManagedRuleSetRuleGroup) 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 "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &m.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &m.Rules) + 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 ManagedRulesDefinition. func (m ManagedRulesDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -22465,20 +22872,872 @@ func (n *NatGatewayListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NatGatewayPropertiesFormat. -func (n NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NatGatewayPropertiesFormat. +func (n NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "idleTimeoutInMinutes", n.IdleTimeoutInMinutes) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "publicIpAddresses", n.PublicIPAddresses) + populate(objectMap, "publicIpPrefixes", n.PublicIPPrefixes) + populate(objectMap, "resourceGuid", n.ResourceGUID) + populate(objectMap, "subnets", n.Subnets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewayPropertiesFormat. +func (n *NatGatewayPropertiesFormat) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &n.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "publicIpAddresses": + err = unpopulate(val, "PublicIPAddresses", &n.PublicIPAddresses) + delete(rawMsg, key) + case "publicIpPrefixes": + err = unpopulate(val, "PublicIPPrefixes", &n.PublicIPPrefixes) + delete(rawMsg, key) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &n.ResourceGUID) + delete(rawMsg, key) + case "subnets": + err = unpopulate(val, "Subnets", &n.Subnets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NatGatewaySKU. +func (n NatGatewaySKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewaySKU. +func (n *NatGatewaySKU) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NatRule. +func (n NatRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "destinationAddresses", n.DestinationAddresses) + populate(objectMap, "destinationPorts", n.DestinationPorts) + populate(objectMap, "ipProtocols", n.IPProtocols) + populate(objectMap, "name", n.Name) + objectMap["ruleType"] = FirewallPolicyRuleTypeNatRule + populate(objectMap, "sourceAddresses", n.SourceAddresses) + populate(objectMap, "sourceIpGroups", n.SourceIPGroups) + populate(objectMap, "translatedAddress", n.TranslatedAddress) + populate(objectMap, "translatedFqdn", n.TranslatedFqdn) + populate(objectMap, "translatedPort", n.TranslatedPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatRule. +func (n *NatRule) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "destinationAddresses": + err = unpopulate(val, "DestinationAddresses", &n.DestinationAddresses) + delete(rawMsg, key) + case "destinationPorts": + err = unpopulate(val, "DestinationPorts", &n.DestinationPorts) + delete(rawMsg, key) + case "ipProtocols": + err = unpopulate(val, "IPProtocols", &n.IPProtocols) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &n.RuleType) + delete(rawMsg, key) + case "sourceAddresses": + err = unpopulate(val, "SourceAddresses", &n.SourceAddresses) + delete(rawMsg, key) + case "sourceIpGroups": + err = unpopulate(val, "SourceIPGroups", &n.SourceIPGroups) + delete(rawMsg, key) + case "translatedAddress": + err = unpopulate(val, "TranslatedAddress", &n.TranslatedAddress) + delete(rawMsg, key) + case "translatedFqdn": + err = unpopulate(val, "TranslatedFqdn", &n.TranslatedFqdn) + delete(rawMsg, key) + case "translatedPort": + err = unpopulate(val, "TranslatedPort", &n.TranslatedPort) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NatRulePortMapping. +func (n NatRulePortMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backendPort", n.BackendPort) + populate(objectMap, "frontendPort", n.FrontendPort) + populate(objectMap, "inboundNatRuleName", n.InboundNatRuleName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NatRulePortMapping. +func (n *NatRulePortMapping) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backendPort": + err = unpopulate(val, "BackendPort", &n.BackendPort) + delete(rawMsg, key) + case "frontendPort": + err = unpopulate(val, "FrontendPort", &n.FrontendPort) + delete(rawMsg, key) + case "inboundNatRuleName": + err = unpopulate(val, "InboundNatRuleName", &n.InboundNatRuleName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NextHopParameters. +func (n NextHopParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationIPAddress", n.DestinationIPAddress) + populate(objectMap, "sourceIPAddress", n.SourceIPAddress) + populate(objectMap, "targetNicResourceId", n.TargetNicResourceID) + populate(objectMap, "targetResourceId", n.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopParameters. +func (n *NextHopParameters) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationIPAddress": + err = unpopulate(val, "DestinationIPAddress", &n.DestinationIPAddress) + delete(rawMsg, key) + case "sourceIPAddress": + err = unpopulate(val, "SourceIPAddress", &n.SourceIPAddress) + delete(rawMsg, key) + case "targetNicResourceId": + err = unpopulate(val, "TargetNicResourceID", &n.TargetNicResourceID) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &n.TargetResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NextHopResult. +func (n NextHopResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextHopIpAddress", n.NextHopIPAddress) + populate(objectMap, "nextHopType", n.NextHopType) + populate(objectMap, "routeTableId", n.RouteTableID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopResult. +func (n *NextHopResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextHopIpAddress": + err = unpopulate(val, "NextHopIPAddress", &n.NextHopIPAddress) + delete(rawMsg, key) + case "nextHopType": + err = unpopulate(val, "NextHopType", &n.NextHopType) + delete(rawMsg, key) + case "routeTableId": + err = unpopulate(val, "RouteTableID", &n.RouteTableID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRule. +func (n NspAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRule. +func (n *NspAccessRule) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleListResult. +func (n NspAccessRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleListResult. +func (n *NspAccessRuleListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. +func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "emailAddresses", n.EmailAddresses) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "phoneNumbers", n.PhoneNumbers) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "serviceTags", n.ServiceTags) + populate(objectMap, "subscriptions", n.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleProperties. +func (n *NspAccessRuleProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &n.EmailAddresses) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "phoneNumbers": + err = unpopulate(val, "PhoneNumbers", &n.PhoneNumbers) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "serviceTags": + err = unpopulate(val, "ServiceTags", &n.ServiceTags) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAssociation. +func (n NspAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAssociation. +func (n *NspAssociation) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAssociationProperties. +func (n NspAssociationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "hasProvisioningIssues", n.HasProvisioningIssues) + populate(objectMap, "privateLinkResource", n.PrivateLinkResource) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningState", n.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAssociationProperties. +func (n *NspAssociationProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) + delete(rawMsg, key) + case "hasProvisioningIssues": + err = unpopulate(val, "HasProvisioningIssues", &n.HasProvisioningIssues) + delete(rawMsg, key) + case "privateLinkResource": + err = unpopulate(val, "PrivateLinkResource", &n.PrivateLinkResource) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAssociationsListResult. +func (n NspAssociationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAssociationsListResult. +func (n *NspAssociationsListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLink. +func (n NspLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLink. +func (n *NspLink) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLinkListResult. +func (n NspLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLinkListResult. +func (n *NspLinkListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLinkProperties. +func (n NspLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoApprovedRemotePerimeterResourceId", n.AutoApprovedRemotePerimeterResourceID) + populate(objectMap, "description", n.Description) + populate(objectMap, "localInboundProfiles", n.LocalInboundProfiles) + populate(objectMap, "localOutboundProfiles", n.LocalOutboundProfiles) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "remoteInboundProfiles", n.RemoteInboundProfiles) + populate(objectMap, "remoteOutboundProfiles", n.RemoteOutboundProfiles) + populate(objectMap, "remotePerimeterGuid", n.RemotePerimeterGUID) + populate(objectMap, "remotePerimeterLocation", n.RemotePerimeterLocation) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLinkProperties. +func (n *NspLinkProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoApprovedRemotePerimeterResourceId": + err = unpopulate(val, "AutoApprovedRemotePerimeterResourceID", &n.AutoApprovedRemotePerimeterResourceID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "localInboundProfiles": + err = unpopulate(val, "LocalInboundProfiles", &n.LocalInboundProfiles) + delete(rawMsg, key) + case "localOutboundProfiles": + err = unpopulate(val, "LocalOutboundProfiles", &n.LocalOutboundProfiles) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "remoteInboundProfiles": + err = unpopulate(val, "RemoteInboundProfiles", &n.RemoteInboundProfiles) + delete(rawMsg, key) + case "remoteOutboundProfiles": + err = unpopulate(val, "RemoteOutboundProfiles", &n.RemoteOutboundProfiles) + delete(rawMsg, key) + case "remotePerimeterGuid": + err = unpopulate(val, "RemotePerimeterGUID", &n.RemotePerimeterGUID) + delete(rawMsg, key) + case "remotePerimeterLocation": + err = unpopulate(val, "RemotePerimeterLocation", &n.RemotePerimeterLocation) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLinkReference. +func (n NspLinkReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLinkReference. +func (n *NspLinkReference) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLinkReferenceListResult. +func (n NspLinkReferenceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLinkReferenceListResult. +func (n *NspLinkReferenceListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLinkReferenceProperties. +func (n NspLinkReferenceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "localInboundProfiles", n.LocalInboundProfiles) + populate(objectMap, "localOutboundProfiles", n.LocalOutboundProfiles) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "remoteInboundProfiles", n.RemoteInboundProfiles) + populate(objectMap, "remoteOutboundProfiles", n.RemoteOutboundProfiles) + populate(objectMap, "remotePerimeterGuid", n.RemotePerimeterGUID) + populate(objectMap, "remotePerimeterLocation", n.RemotePerimeterLocation) + populate(objectMap, "remotePerimeterResourceId", n.RemotePerimeterResourceID) + populate(objectMap, "status", n.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLinkReferenceProperties. +func (n *NspLinkReferenceProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "localInboundProfiles": + err = unpopulate(val, "LocalInboundProfiles", &n.LocalInboundProfiles) + delete(rawMsg, key) + case "localOutboundProfiles": + err = unpopulate(val, "LocalOutboundProfiles", &n.LocalOutboundProfiles) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "remoteInboundProfiles": + err = unpopulate(val, "RemoteInboundProfiles", &n.RemoteInboundProfiles) + delete(rawMsg, key) + case "remoteOutboundProfiles": + err = unpopulate(val, "RemoteOutboundProfiles", &n.RemoteOutboundProfiles) + delete(rawMsg, key) + case "remotePerimeterGuid": + err = unpopulate(val, "RemotePerimeterGUID", &n.RemotePerimeterGUID) + delete(rawMsg, key) + case "remotePerimeterLocation": + err = unpopulate(val, "RemotePerimeterLocation", &n.RemotePerimeterLocation) + delete(rawMsg, key) + case "remotePerimeterResourceId": + err = unpopulate(val, "RemotePerimeterResourceID", &n.RemotePerimeterResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &n.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLoggingConfiguration. +func (n NspLoggingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLoggingConfiguration. +func (n *NspLoggingConfiguration) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLoggingConfigurationListResult. +func (n NspLoggingConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLoggingConfigurationListResult. +func (n *NspLoggingConfigurationListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspLoggingConfigurationProperties. +func (n NspLoggingConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "idleTimeoutInMinutes", n.IdleTimeoutInMinutes) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "publicIpAddresses", n.PublicIPAddresses) - populate(objectMap, "publicIpPrefixes", n.PublicIPPrefixes) - populate(objectMap, "resourceGuid", n.ResourceGUID) - populate(objectMap, "subnets", n.Subnets) + populate(objectMap, "enabledLogCategories", n.EnabledLogCategories) + populate(objectMap, "version", n.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewayPropertiesFormat. -func (n *NatGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspLoggingConfigurationProperties. +func (n *NspLoggingConfigurationProperties) 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", n, err) @@ -22486,50 +23745,11 @@ func (n *NatGatewayPropertiesFormat) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &n.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "enabledLogCategories": + err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories) delete(rawMsg, key) - case "publicIpAddresses": - err = unpopulate(val, "PublicIPAddresses", &n.PublicIPAddresses) - delete(rawMsg, key) - case "publicIpPrefixes": - err = unpopulate(val, "PublicIPPrefixes", &n.PublicIPPrefixes) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &n.ResourceGUID) - delete(rawMsg, key) - case "subnets": - err = unpopulate(val, "Subnets", &n.Subnets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatGatewaySKU. -func (n NatGatewaySKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", n.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatGatewaySKU. -func (n *NatGatewaySKU) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &n.Name) + case "version": + err = unpopulate(val, "Version", &n.Version) delete(rawMsg, key) } if err != nil { @@ -22539,25 +23759,20 @@ func (n *NatGatewaySKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NatRule. -func (n NatRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspProfile. +func (n NspProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", n.Description) - populate(objectMap, "destinationAddresses", n.DestinationAddresses) - populate(objectMap, "destinationPorts", n.DestinationPorts) - populate(objectMap, "ipProtocols", n.IPProtocols) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) - objectMap["ruleType"] = FirewallPolicyRuleTypeNatRule - populate(objectMap, "sourceAddresses", n.SourceAddresses) - populate(objectMap, "sourceIpGroups", n.SourceIPGroups) - populate(objectMap, "translatedAddress", n.TranslatedAddress) - populate(objectMap, "translatedFqdn", n.TranslatedFqdn) - populate(objectMap, "translatedPort", n.TranslatedPort) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NatRule. -func (n *NatRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspProfile. +func (n *NspProfile) 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", n, err) @@ -22565,73 +23780,23 @@ func (n *NatRule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &n.Description) - delete(rawMsg, key) - case "destinationAddresses": - err = unpopulate(val, "DestinationAddresses", &n.DestinationAddresses) - delete(rawMsg, key) - case "destinationPorts": - err = unpopulate(val, "DestinationPorts", &n.DestinationPorts) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "ipProtocols": - err = unpopulate(val, "IPProtocols", &n.IPProtocols) + case "location": + err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &n.RuleType) - delete(rawMsg, key) - case "sourceAddresses": - err = unpopulate(val, "SourceAddresses", &n.SourceAddresses) - delete(rawMsg, key) - case "sourceIpGroups": - err = unpopulate(val, "SourceIPGroups", &n.SourceIPGroups) - delete(rawMsg, key) - case "translatedAddress": - err = unpopulate(val, "TranslatedAddress", &n.TranslatedAddress) - delete(rawMsg, key) - case "translatedFqdn": - err = unpopulate(val, "TranslatedFqdn", &n.TranslatedFqdn) - delete(rawMsg, key) - case "translatedPort": - err = unpopulate(val, "TranslatedPort", &n.TranslatedPort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NatRulePortMapping. -func (n NatRulePortMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backendPort", n.BackendPort) - populate(objectMap, "frontendPort", n.FrontendPort) - populate(objectMap, "inboundNatRuleName", n.InboundNatRuleName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NatRulePortMapping. -func (n *NatRulePortMapping) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backendPort": - err = unpopulate(val, "BackendPort", &n.BackendPort) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "frontendPort": - err = unpopulate(val, "FrontendPort", &n.FrontendPort) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) - case "inboundNatRuleName": - err = unpopulate(val, "InboundNatRuleName", &n.InboundNatRuleName) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { @@ -22641,18 +23806,16 @@ func (n *NatRulePortMapping) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NextHopParameters. -func (n NextHopParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspProfileListResult. +func (n NspProfileListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destinationIPAddress", n.DestinationIPAddress) - populate(objectMap, "sourceIPAddress", n.SourceIPAddress) - populate(objectMap, "targetNicResourceId", n.TargetNicResourceID) - populate(objectMap, "targetResourceId", n.TargetResourceID) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopParameters. -func (n *NextHopParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspProfileListResult. +func (n *NspProfileListResult) 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", n, err) @@ -22660,17 +23823,11 @@ func (n *NextHopParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "destinationIPAddress": - err = unpopulate(val, "DestinationIPAddress", &n.DestinationIPAddress) - delete(rawMsg, key) - case "sourceIPAddress": - err = unpopulate(val, "SourceIPAddress", &n.SourceIPAddress) - delete(rawMsg, key) - case "targetNicResourceId": - err = unpopulate(val, "TargetNicResourceID", &n.TargetNicResourceID) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) - case "targetResourceId": - err = unpopulate(val, "TargetResourceID", &n.TargetResourceID) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { @@ -22680,17 +23837,16 @@ func (n *NextHopParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NextHopResult. -func (n NextHopResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NspProfileProperties. +func (n NspProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextHopIpAddress", n.NextHopIPAddress) - populate(objectMap, "nextHopType", n.NextHopType) - populate(objectMap, "routeTableId", n.RouteTableID) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NextHopResult. -func (n *NextHopResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NspProfileProperties. +func (n *NspProfileProperties) 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", n, err) @@ -22698,14 +23854,11 @@ func (n *NextHopResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextHopIpAddress": - err = unpopulate(val, "NextHopIPAddress", &n.NextHopIPAddress) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) delete(rawMsg, key) - case "nextHopType": - err = unpopulate(val, "NextHopType", &n.NextHopType) - delete(rawMsg, key) - case "routeTableId": - err = unpopulate(val, "RouteTableID", &n.RouteTableID) + case "diagnosticSettingsVersion": + err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion) delete(rawMsg, key) } if err != nil { @@ -22971,6 +24124,65 @@ func (o *OperationPropertiesFormatServiceSpecification) UnmarshalJSON(data []byt return nil } +// 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) + 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) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. +func (o *OperationStatusResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "operations": + err = unpopulate(val, "Operations", &o.Operations) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &o.ResourceID) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type OrderBy. func (o OrderBy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -24216,6 +25428,154 @@ func (p *PeerRoute) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PerimeterAssociableResource. +func (p PerimeterAssociableResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + 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 PerimeterAssociableResource. +func (p *PerimeterAssociableResource) 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 "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 PerimeterAssociableResourceProperties. +func (p PerimeterAssociableResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "publicDnsZones", p.PublicDNSZones) + populate(objectMap, "resourceType", p.ResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerimeterAssociableResourceProperties. +func (p *PerimeterAssociableResourceProperties) 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 "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "publicDnsZones": + err = unpopulate(val, "PublicDNSZones", &p.PublicDNSZones) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &p.ResourceType) + 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 PerimeterAssociableResourcesListResult. +func (p PerimeterAssociableResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerimeterAssociableResourcesListResult. +func (p *PerimeterAssociableResourcesListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + 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 PerimeterBasedAccessRule. +func (p PerimeterBasedAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "perimeterGuid", p.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerimeterBasedAccessRule. +func (p *PerimeterBasedAccessRule) 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 "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &p.PerimeterGUID) + 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 PolicySettings. func (p PolicySettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -25294,25 +26654,350 @@ func (p *PrivateLinkServiceListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceProperties. -func (p PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceProperties. +func (p PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alias", p.Alias) + populate(objectMap, "autoApproval", p.AutoApproval) + populate(objectMap, "destinationIPAddress", p.DestinationIPAddress) + populate(objectMap, "enableProxyProtocol", p.EnableProxyProtocol) + populate(objectMap, "fqdns", p.Fqdns) + populate(objectMap, "ipConfigurations", p.IPConfigurations) + populate(objectMap, "loadBalancerFrontendIpConfigurations", p.LoadBalancerFrontendIPConfigurations) + populate(objectMap, "networkInterfaces", p.NetworkInterfaces) + populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "visibility", p.Visibility) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceProperties. +func (p *PrivateLinkServiceProperties) 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 "alias": + err = unpopulate(val, "Alias", &p.Alias) + delete(rawMsg, key) + case "autoApproval": + err = unpopulate(val, "AutoApproval", &p.AutoApproval) + delete(rawMsg, key) + case "destinationIPAddress": + err = unpopulate(val, "DestinationIPAddress", &p.DestinationIPAddress) + delete(rawMsg, key) + case "enableProxyProtocol": + err = unpopulate(val, "EnableProxyProtocol", &p.EnableProxyProtocol) + delete(rawMsg, key) + case "fqdns": + err = unpopulate(val, "Fqdns", &p.Fqdns) + delete(rawMsg, key) + case "ipConfigurations": + err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) + delete(rawMsg, key) + case "loadBalancerFrontendIpConfigurations": + err = unpopulate(val, "LoadBalancerFrontendIPConfigurations", &p.LoadBalancerFrontendIPConfigurations) + delete(rawMsg, key) + case "networkInterfaces": + err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "visibility": + err = unpopulate(val, "Visibility", &p.Visibility) + 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 PrivateLinkServicePropertiesAutoApproval. +func (p PrivateLinkServicePropertiesAutoApproval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", p.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesAutoApproval. +func (p *PrivateLinkServicePropertiesAutoApproval) 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 "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + 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 PrivateLinkServicePropertiesVisibility. +func (p PrivateLinkServicePropertiesVisibility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", p.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesVisibility. +func (p *PrivateLinkServicePropertiesVisibility) 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 "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + 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 PrivateLinkServiceVisibility. +func (p PrivateLinkServiceVisibility) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "visible", p.Visible) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceVisibility. +func (p *PrivateLinkServiceVisibility) 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 "visible": + err = unpopulate(val, "Visible", &p.Visible) + 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 Probe. +func (p Probe) 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, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Probe. +func (p *Probe) 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 "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 ProbePropertiesFormat. +func (p ProbePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "intervalInSeconds", p.IntervalInSeconds) + populate(objectMap, "loadBalancingRules", p.LoadBalancingRules) + populate(objectMap, "noHealthyBackendsBehavior", p.NoHealthyBackendsBehavior) + populate(objectMap, "numberOfProbes", p.NumberOfProbes) + populate(objectMap, "port", p.Port) + populate(objectMap, "probeThreshold", p.ProbeThreshold) + populate(objectMap, "protocol", p.Protocol) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "requestPath", p.RequestPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProbePropertiesFormat. +func (p *ProbePropertiesFormat) 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 "intervalInSeconds": + err = unpopulate(val, "IntervalInSeconds", &p.IntervalInSeconds) + delete(rawMsg, key) + case "loadBalancingRules": + err = unpopulate(val, "LoadBalancingRules", &p.LoadBalancingRules) + delete(rawMsg, key) + case "noHealthyBackendsBehavior": + err = unpopulate(val, "NoHealthyBackendsBehavior", &p.NoHealthyBackendsBehavior) + delete(rawMsg, key) + case "numberOfProbes": + err = unpopulate(val, "NumberOfProbes", &p.NumberOfProbes) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &p.Port) + delete(rawMsg, key) + case "probeThreshold": + err = unpopulate(val, "ProbeThreshold", &p.ProbeThreshold) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &p.Protocol) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "requestPath": + err = unpopulate(val, "RequestPath", &p.RequestPath) + 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 Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", p.Etag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + 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 Profile. +func (p *Profile) 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 "location": + err = unpopulate(val, "Location", &p.Location) + 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 ProfileListResult. +func (p ProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult. +func (p *ProfileListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + 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 ProfilePropertiesFormat. +func (p ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "alias", p.Alias) - populate(objectMap, "autoApproval", p.AutoApproval) - populate(objectMap, "destinationIPAddress", p.DestinationIPAddress) - populate(objectMap, "enableProxyProtocol", p.EnableProxyProtocol) - populate(objectMap, "fqdns", p.Fqdns) - populate(objectMap, "ipConfigurations", p.IPConfigurations) - populate(objectMap, "loadBalancerFrontendIpConfigurations", p.LoadBalancerFrontendIPConfigurations) - populate(objectMap, "networkInterfaces", p.NetworkInterfaces) - populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "containerNetworkInterfaceConfigurations", p.ContainerNetworkInterfaceConfigurations) + populate(objectMap, "containerNetworkInterfaces", p.ContainerNetworkInterfaces) populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "visibility", p.Visibility) + populate(objectMap, "resourceGuid", p.ResourceGUID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceProperties. -func (p *PrivateLinkServiceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesFormat. +func (p *ProfilePropertiesFormat) 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) @@ -25320,119 +27005,17 @@ func (p *PrivateLinkServiceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "alias": - err = unpopulate(val, "Alias", &p.Alias) - delete(rawMsg, key) - case "autoApproval": - err = unpopulate(val, "AutoApproval", &p.AutoApproval) - delete(rawMsg, key) - case "destinationIPAddress": - err = unpopulate(val, "DestinationIPAddress", &p.DestinationIPAddress) - delete(rawMsg, key) - case "enableProxyProtocol": - err = unpopulate(val, "EnableProxyProtocol", &p.EnableProxyProtocol) - delete(rawMsg, key) - case "fqdns": - err = unpopulate(val, "Fqdns", &p.Fqdns) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &p.IPConfigurations) - delete(rawMsg, key) - case "loadBalancerFrontendIpConfigurations": - err = unpopulate(val, "LoadBalancerFrontendIPConfigurations", &p.LoadBalancerFrontendIPConfigurations) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &p.NetworkInterfaces) + case "containerNetworkInterfaceConfigurations": + err = unpopulate(val, "ContainerNetworkInterfaceConfigurations", &p.ContainerNetworkInterfaceConfigurations) delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) + case "containerNetworkInterfaces": + err = unpopulate(val, "ContainerNetworkInterfaces", &p.ContainerNetworkInterfaces) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) - case "visibility": - err = unpopulate(val, "Visibility", &p.Visibility) - 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 PrivateLinkServicePropertiesAutoApproval. -func (p PrivateLinkServicePropertiesAutoApproval) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "subscriptions", p.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesAutoApproval. -func (p *PrivateLinkServicePropertiesAutoApproval) 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 "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - 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 PrivateLinkServicePropertiesVisibility. -func (p PrivateLinkServicePropertiesVisibility) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "subscriptions", p.Subscriptions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServicePropertiesVisibility. -func (p *PrivateLinkServicePropertiesVisibility) 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 "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - 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 PrivateLinkServiceVisibility. -func (p PrivateLinkServiceVisibility) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "visible", p.Visible) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceVisibility. -func (p *PrivateLinkServiceVisibility) 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 "visible": - err = unpopulate(val, "Visible", &p.Visible) + case "resourceGuid": + err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) delete(rawMsg, key) } if err != nil { @@ -25442,19 +27025,16 @@ func (p *PrivateLinkServiceVisibility) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Probe. -func (p Probe) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PropagatedRouteTable. +func (p PropagatedRouteTable) 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, "type", p.Type) + populate(objectMap, "ids", p.IDs) + populate(objectMap, "labels", p.Labels) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Probe. -func (p *Probe) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PropagatedRouteTable. +func (p *PropagatedRouteTable) 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) @@ -25462,20 +27042,11 @@ func (p *Probe) UnmarshalJSON(data []byte) error { 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) + case "ids": + err = unpopulate(val, "IDs", &p.IDs) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "labels": + err = unpopulate(val, "Labels", &p.Labels) delete(rawMsg, key) } if err != nil { @@ -25485,23 +27056,15 @@ func (p *Probe) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProbePropertiesFormat. -func (p ProbePropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProtocolConfiguration. +func (p ProtocolConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "intervalInSeconds", p.IntervalInSeconds) - populate(objectMap, "loadBalancingRules", p.LoadBalancingRules) - populate(objectMap, "noHealthyBackendsBehavior", p.NoHealthyBackendsBehavior) - populate(objectMap, "numberOfProbes", p.NumberOfProbes) - populate(objectMap, "port", p.Port) - populate(objectMap, "probeThreshold", p.ProbeThreshold) - populate(objectMap, "protocol", p.Protocol) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "requestPath", p.RequestPath) + populate(objectMap, "HTTPConfiguration", p.HTTPConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProbePropertiesFormat. -func (p *ProbePropertiesFormat) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolConfiguration. +func (p *ProtocolConfiguration) 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) @@ -25509,32 +27072,8 @@ func (p *ProbePropertiesFormat) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "intervalInSeconds": - err = unpopulate(val, "IntervalInSeconds", &p.IntervalInSeconds) - delete(rawMsg, key) - case "loadBalancingRules": - err = unpopulate(val, "LoadBalancingRules", &p.LoadBalancingRules) - delete(rawMsg, key) - case "noHealthyBackendsBehavior": - err = unpopulate(val, "NoHealthyBackendsBehavior", &p.NoHealthyBackendsBehavior) - delete(rawMsg, key) - case "numberOfProbes": - err = unpopulate(val, "NumberOfProbes", &p.NumberOfProbes) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &p.Port) - delete(rawMsg, key) - case "probeThreshold": - err = unpopulate(val, "ProbeThreshold", &p.ProbeThreshold) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &p.Protocol) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "requestPath": - err = unpopulate(val, "RequestPath", &p.RequestPath) + case "HTTPConfiguration": + err = unpopulate(val, "HTTPConfiguration", &p.HTTPConfiguration) delete(rawMsg, key) } if err != nil { @@ -25544,21 +27083,18 @@ func (p *ProbePropertiesFormat) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Profile. -func (p Profile) MarshalJSON() ([]byte, error) { +// 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, "location", p.Location) 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 Profile. -func (p *Profile) UnmarshalJSON(data []byte) error { +// 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) @@ -25572,18 +27108,9 @@ func (p *Profile) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - 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) @@ -25595,134 +27122,6 @@ func (p *Profile) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProfileListResult. -func (p ProfileListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult. -func (p *ProfileListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - 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 ProfilePropertiesFormat. -func (p ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerNetworkInterfaceConfigurations", p.ContainerNetworkInterfaceConfigurations) - populate(objectMap, "containerNetworkInterfaces", p.ContainerNetworkInterfaces) - populate(objectMap, "provisioningState", p.ProvisioningState) - populate(objectMap, "resourceGuid", p.ResourceGUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesFormat. -func (p *ProfilePropertiesFormat) 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 "containerNetworkInterfaceConfigurations": - err = unpopulate(val, "ContainerNetworkInterfaceConfigurations", &p.ContainerNetworkInterfaceConfigurations) - delete(rawMsg, key) - case "containerNetworkInterfaces": - err = unpopulate(val, "ContainerNetworkInterfaces", &p.ContainerNetworkInterfaces) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - case "resourceGuid": - err = unpopulate(val, "ResourceGUID", &p.ResourceGUID) - 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 PropagatedRouteTable. -func (p PropagatedRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ids", p.IDs) - populate(objectMap, "labels", p.Labels) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PropagatedRouteTable. -func (p *PropagatedRouteTable) 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 "ids": - err = unpopulate(val, "IDs", &p.IDs) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &p.Labels) - 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 ProtocolConfiguration. -func (p ProtocolConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "HTTPConfiguration", p.HTTPConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolConfiguration. -func (p *ProtocolConfiguration) 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 "HTTPConfiguration": - err = unpopulate(val, "HTTPConfiguration", &p.HTTPConfiguration) - 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) @@ -26773,6 +28172,45 @@ func (r *ReferencedPublicIPAddress) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResiliencyRecommendationComponents. +func (r ResiliencyRecommendationComponents) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentScore", r.CurrentScore) + populate(objectMap, "maxScore", r.MaxScore) + populate(objectMap, "name", r.Name) + populate(objectMap, "recommendations", r.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResiliencyRecommendationComponents. +func (r *ResiliencyRecommendationComponents) 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 "currentScore": + err = unpopulate(val, "CurrentScore", &r.CurrentScore) + delete(rawMsg, key) + case "maxScore": + err = unpopulate(val, "MaxScore", &r.MaxScore) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &r.Recommendations) + 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 Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -27486,6 +28924,41 @@ func (r *RoutePropertiesFormat) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RouteSourceDetails. +func (r RouteSourceDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "circuit", r.Circuit) + populate(objectMap, "pri", r.Pri) + populate(objectMap, "sec", r.Sec) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteSourceDetails. +func (r *RouteSourceDetails) 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 "circuit": + err = unpopulate(val, "Circuit", &r.Circuit) + delete(rawMsg, key) + case "pri": + err = unpopulate(val, "Pri", &r.Pri) + delete(rawMsg, key) + case "sec": + err = unpopulate(val, "Sec", &r.Sec) + 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 RouteTable. func (r RouteTable) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -28769,6 +30242,115 @@ func (s *SecurityPartnerProviderPropertiesFormat) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type SecurityPerimeter. +func (s SecurityPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPerimeter. +func (s *SecurityPerimeter) 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 "location": + err = unpopulate(val, "Location", &s.Location) + 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 "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 SecurityPerimeterListResult. +func (s SecurityPerimeterListResult) 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 SecurityPerimeterListResult. +func (s *SecurityPerimeterListResult) 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 SecurityPerimeterProperties. +func (s SecurityPerimeterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "perimeterGuid", s.PerimeterGUID) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPerimeterProperties. +func (s *SecurityPerimeterProperties) 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 "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &s.PerimeterGUID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + 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 SecurityRule. func (s SecurityRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -30826,6 +32408,33 @@ func (s *SubnetPropertiesFormat) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SubscriptionID. +func (s SubscriptionID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionID. +func (s *SubscriptionID) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SwapResource. func (s SwapResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -31495,6 +33104,37 @@ func (u *UnprepareNetworkPoliciesRequest) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UpdateTagsRequest. +func (u UpdateTagsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "tags", u.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateTagsRequest. +func (u *UpdateTagsRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &u.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Usage. func (u Usage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -33663,6 +35303,7 @@ func (v *VerificationIPFlowResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VerifierWorkspace. func (v VerifierWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "etag", v.Etag) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) @@ -33682,6 +35323,9 @@ func (v *VerifierWorkspace) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &v.Etag) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &v.ID) delete(rawMsg, key) @@ -33917,6 +35561,41 @@ func (v *VirtualApplianceAdditionalNicProperties) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceBootDiagnosticParameters. +func (v VirtualApplianceBootDiagnosticParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "consoleScreenshotStorageSasUrl", v.ConsoleScreenshotStorageSasURL) + populate(objectMap, "instanceId", v.InstanceID) + populate(objectMap, "serialConsoleStorageSasUrl", v.SerialConsoleStorageSasURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceBootDiagnosticParameters. +func (v *VirtualApplianceBootDiagnosticParameters) 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 "consoleScreenshotStorageSasUrl": + err = unpopulate(val, "ConsoleScreenshotStorageSasURL", &v.ConsoleScreenshotStorageSasURL) + delete(rawMsg, key) + case "instanceId": + err = unpopulate(val, "InstanceID", &v.InstanceID) + delete(rawMsg, key) + case "serialConsoleStorageSasUrl": + err = unpopulate(val, "SerialConsoleStorageSasURL", &v.SerialConsoleStorageSasURL) + 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 VirtualApplianceConnection. func (v VirtualApplianceConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -34092,6 +35771,33 @@ func (v *VirtualApplianceIPConfigurationProperties) UnmarshalJSON(data []byte) e return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualApplianceInstanceID. +func (v VirtualApplianceInstanceID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceId", v.InstanceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualApplianceInstanceID. +func (v *VirtualApplianceInstanceID) 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 "instanceId": + err = unpopulate(val, "InstanceID", &v.InstanceID) + 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 VirtualApplianceInstanceIDs. func (v VirtualApplianceInstanceIDs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -35918,6 +37624,72 @@ func (v *VirtualNetworkGatewayListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkGatewayMigrationParameters. +func (v VirtualNetworkGatewayMigrationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migrationType", v.MigrationType) + populate(objectMap, "resourceUrl", v.ResourceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayMigrationParameters. +func (v *VirtualNetworkGatewayMigrationParameters) 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 "migrationType": + err = unpopulate(val, "MigrationType", &v.MigrationType) + delete(rawMsg, key) + case "resourceUrl": + err = unpopulate(val, "ResourceURL", &v.ResourceURL) + 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 VirtualNetworkGatewayMigrationStatus. +func (v VirtualNetworkGatewayMigrationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", v.ErrorMessage) + populate(objectMap, "phase", v.Phase) + populate(objectMap, "state", v.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayMigrationStatus. +func (v *VirtualNetworkGatewayMigrationStatus) 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 "errorMessage": + err = unpopulate(val, "ErrorMessage", &v.ErrorMessage) + delete(rawMsg, key) + case "phase": + err = unpopulate(val, "Phase", &v.Phase) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + 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 VirtualNetworkGatewayNatRule. func (v VirtualNetworkGatewayNatRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -36139,6 +37911,7 @@ func (v VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "enableBgp", v.EnableBgp) populate(objectMap, "enableBgpRouteTranslationForNat", v.EnableBgpRouteTranslationForNat) populate(objectMap, "enableDnsForwarding", v.EnableDNSForwarding) + populate(objectMap, "enableHighBandwidthVpnGateway", v.EnableHighBandwidthVPNGateway) populate(objectMap, "enablePrivateIpAddress", v.EnablePrivateIPAddress) populate(objectMap, "gatewayDefaultSite", v.GatewayDefaultSite) populate(objectMap, "gatewayType", v.GatewayType) @@ -36153,6 +37926,7 @@ func (v VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { populate(objectMap, "vpnClientConfiguration", v.VPNClientConfiguration) populate(objectMap, "vpnGatewayGeneration", v.VPNGatewayGeneration) populate(objectMap, "vpnType", v.VPNType) + populate(objectMap, "virtualNetworkGatewayMigrationStatus", v.VirtualNetworkGatewayMigrationStatus) populate(objectMap, "virtualNetworkGatewayPolicyGroups", v.VirtualNetworkGatewayPolicyGroups) return json.Marshal(objectMap) } @@ -36199,6 +37973,9 @@ func (v *VirtualNetworkGatewayPropertiesFormat) UnmarshalJSON(data []byte) error case "enableDnsForwarding": err = unpopulate(val, "EnableDNSForwarding", &v.EnableDNSForwarding) delete(rawMsg, key) + case "enableHighBandwidthVpnGateway": + err = unpopulate(val, "EnableHighBandwidthVPNGateway", &v.EnableHighBandwidthVPNGateway) + delete(rawMsg, key) case "enablePrivateIpAddress": err = unpopulate(val, "EnablePrivateIPAddress", &v.EnablePrivateIPAddress) delete(rawMsg, key) @@ -36241,6 +38018,9 @@ func (v *VirtualNetworkGatewayPropertiesFormat) UnmarshalJSON(data []byte) error case "vpnType": err = unpopulate(val, "VPNType", &v.VPNType) delete(rawMsg, key) + case "virtualNetworkGatewayMigrationStatus": + err = unpopulate(val, "VirtualNetworkGatewayMigrationStatus", &v.VirtualNetworkGatewayMigrationStatus) + delete(rawMsg, key) case "virtualNetworkGatewayPolicyGroups": err = unpopulate(val, "VirtualNetworkGatewayPolicyGroups", &v.VirtualNetworkGatewayPolicyGroups) delete(rawMsg, key) diff --git a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go index f63b2fd57f0d..440975d93893 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/natgateway_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client.go b/sdk/resourcemanager/network/armnetwork/natgateways_client.go index c30b1dfe5a6e..48062396fe84 100644 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/natgateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to the create or update nat gateway operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *NatGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *NatGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "NatGatewaysClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *NatGatewaysClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, natGatewayName string, options *NatGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -195,7 +192,7 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *NatGatewaysClient) deleteCreateRequest(ctx context.Context, resour // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - options - NatGatewaysClientGetOptions contains the optional parameters for the NatGatewaysClient.Get method. @@ -253,7 +250,7 @@ func (client *NatGatewaysClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *NatGatewaysClient) getHandleResponse(resp *http.Response) (NatGate // NewListPager - Gets all nat gateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - NatGatewaysClientListOptions contains the optional parameters for the NatGatewaysClient.NewListPager method. func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options *NatGatewaysClientListOptions) *runtime.Pager[NatGatewaysClientListResponse] { @@ -297,7 +294,7 @@ func (client *NatGatewaysClient) NewListPager(resourceGroupName string, options } // listCreateRequest creates the List request. -func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *NatGatewaysClientListOptions) (*policy.Request, error) { +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") @@ -312,7 +309,7 @@ func (client *NatGatewaysClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +326,7 @@ func (client *NatGatewaysClient) listHandleResponse(resp *http.Response) (NatGat // NewListAllPager - Gets all the Nat Gateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -355,7 +352,7 @@ func (client *NatGatewaysClient) NewListAllPager(options *NatGatewaysClientListA } // listAllCreateRequest creates the ListAll request. -func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, options *NatGatewaysClientListAllOptions) (*policy.Request, error) { +func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, _ *NatGatewaysClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -366,7 +363,7 @@ func (client *NatGatewaysClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +381,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - natGatewayName - The name of the nat gateway. // - parameters - Parameters supplied to update nat gateway tags. @@ -412,7 +409,7 @@ 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, options *NatGatewaysClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -431,7 +428,7 @@ func (client *NatGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go deleted file mode 100644 index 926510d67669..000000000000 --- a/sdk/resourcemanager/network/armnetwork/natgateways_client_example_test.go +++ /dev/null @@ -1,359 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatGatewaysClient().BeginDelete(ctx, "rg1", "test-natGateway", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NatGatewayGet.json -func ExampleNatGatewaysClient_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.NewNatGatewaysClient().Get(ctx, "rg1", "test-natGateway", &armnetwork.NatGatewaysClientGetOptions{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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NatGatewayCreateOrUpdate.json -func ExampleNatGatewaysClient_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.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.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 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NatGatewayUpdateTags.json -func ExampleNatGatewaysClient_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.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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatGatewaysClient().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.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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatGatewaysClient().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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/natrules_client.go b/sdk/resourcemanager/network/armnetwork/natrules_client.go index f521f3520f73..8a165daa67c4 100644 --- a/sdk/resourcemanager/network/armnetwork/natrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/natrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *NatRulesClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, options *NatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VPNGatewayNatRule, _ *NatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *NatRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -182,7 +179,7 @@ func (client *NatRulesClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, _ *NatRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -205,7 +202,7 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *NatRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves the details of a nat ruleGet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -242,7 +239,7 @@ func (client *NatRulesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, options *NatRulesClientGetOptions) (*policy.Request, error) { +func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, _ *NatRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -265,7 +262,7 @@ func (client *NatRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +279,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - NatRulesClientListByVPNGatewayOptions contains the optional parameters for the NatRulesClient.NewListByVPNGatewayPager @@ -311,7 +308,7 @@ func (client *NatRulesClient) NewListByVPNGatewayPager(resourceGroupName string, } // listByVPNGatewayCreateRequest creates the ListByVPNGateway request. -func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *NatRulesClientListByVPNGatewayOptions) (*policy.Request, error) { +func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *NatRulesClientListByVPNGatewayOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -330,7 +327,7 @@ func (client *NatRulesClient) listByVPNGatewayCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 0e402752c247..000000000000 --- a/sdk/resourcemanager/network/armnetwork/natrules_client_example_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNatRulesClient().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.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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNatRulesClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNatRulesClient().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.ListVPNGatewayNatRulesResult = armnetwork.ListVPNGatewayNatRulesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go index 67d8aa6bc7c1..31f9ea1ddba9 100644 --- a/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkinterface_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 49ae4a788fdd..fe0451dd30ee 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanager_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 3427d822c0ef..d1173f44f1b5 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnection_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 7dab772fdd35..32c823bf9a62 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagerconnectivityconfiguration_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 22110664e9ef..c5b2db9c9bc2 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagergroup_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 dac5c874884e..1b33f7ea9b5c 100644 --- a/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkmanagersecurityadminconfiguration_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 781ffd39fea2..f09c9d8f0bec 100644 --- a/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkprofile_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 872e603dd062..b0e883f85da7 100644 --- a/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networksecuritygroup_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "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 367bcc90ae2e..5dc6b0541628 100644 --- a/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/networkwatcher_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/nspassociationreconcile_client.go b/sdk/resourcemanager/network/armnetwork/nspassociationreconcile_client.go new file mode 100644 index 000000000000..37708a3fd228 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/nspassociationreconcile_client.go @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// NspAssociationReconcileClient contains the methods for the NspAssociationReconcile group. +// Don't use this type directly, use NewNspAssociationReconcileClient() instead. +type NspAssociationReconcileClient struct { + internal *arm.Client + subscriptionID string +} + +// NewNspAssociationReconcileClient creates a new instance of NspAssociationReconcileClient 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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewNspAssociationReconcileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NspAssociationReconcileClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NspAssociationReconcileClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Post - Reconcile NSP association +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - associationName - The name of the NSP association. +// - parameters - Parameters for NSP association reconcile +// - options - NspAssociationReconcileClientPostOptions contains the optional parameters for the NspAssociationReconcileClient.Post +// method. +func (client *NspAssociationReconcileClient) Post(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters any, options *NspAssociationReconcileClientPostOptions) (NspAssociationReconcileClientPostResponse, error) { + var err error + const operationName = "NspAssociationReconcileClient.Post" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.postCreateRequest(ctx, resourceGroupName, networkSecurityPerimeterName, associationName, parameters, options) + if err != nil { + return NspAssociationReconcileClientPostResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NspAssociationReconcileClientPostResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NspAssociationReconcileClientPostResponse{}, err + } + resp, err := client.postHandleResponse(httpResp) + return resp, err +} + +// postCreateRequest creates the Post request. +func (client *NspAssociationReconcileClient) postCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters any, _ *NspAssociationReconcileClientPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// postHandleResponse handles the Post response. +func (client *NspAssociationReconcileClient) postHandleResponse(resp *http.Response) (NspAssociationReconcileClientPostResponse, error) { + result := NspAssociationReconcileClientPostResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return NspAssociationReconcileClientPostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/operation_live_test.go b/sdk/resourcemanager/network/armnetwork/operation_live_test.go index 3ba253a42bdb..827b5e8a8592 100644 --- a/sdk/resourcemanager/network/armnetwork/operation_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/operation_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/operations_client.go b/sdk/resourcemanager/network/armnetwork/operations_client.go index d331102c91c7..08397d3c9349 100644 --- a/sdk/resourcemanager/network/armnetwork/operations_client.go +++ b/sdk/resourcemanager/network/armnetwork/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Network Rest API operations. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Network/operations" 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 827a7cef8446..000000000000 --- a/sdk/resourcemanager/network/armnetwork/operations_client_example_test.go +++ /dev/null @@ -1,166 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = 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"), - // }, - // }, - // { - // 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/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{ - // }, - // 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"), - // }, - // { - // 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"), - // }}, - // }, - // }, - // }, - // { - // 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"), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/options.go b/sdk/resourcemanager/network/armnetwork/options.go index d2d0ed5cee28..9116af4861b0 100644 --- a/sdk/resourcemanager/network/armnetwork/options.go +++ b/sdk/resourcemanager/network/armnetwork/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ type AdminRuleCollectionsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -48,7 +45,7 @@ type AdminRulesClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -76,14 +73,14 @@ type AdminRulesClientListOptions struct { // ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginDelete // method. type ApplicationGatewayPrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the ApplicationGatewayPrivateEndpointConnectionsClient.BeginUpdate // method. type ApplicationGatewayPrivateEndpointConnectionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -123,7 +120,7 @@ type ApplicationGatewaysClientBeginBackendHealthOnDemandOptions struct { // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. Expand *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -133,35 +130,35 @@ type ApplicationGatewaysClientBeginBackendHealthOptions struct { // Expands BackendAddressPool and BackendHttpSettings referenced in backend health. Expand *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationGatewaysClient.BeginCreateOrUpdate // method. type ApplicationGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationGatewaysClientBeginDeleteOptions contains the optional parameters for the ApplicationGatewaysClient.BeginDelete // method. type ApplicationGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationGatewaysClientBeginStartOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStart // method. type ApplicationGatewaysClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationGatewaysClientBeginStopOptions contains the optional parameters for the ApplicationGatewaysClient.BeginStop // method. type ApplicationGatewaysClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -232,14 +229,14 @@ type ApplicationGatewaysClientUpdateTagsOptions struct { // ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginCreateOrUpdate // method. type ApplicationSecurityGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ApplicationSecurityGroupsClientBeginDeleteOptions contains the optional parameters for the ApplicationSecurityGroupsClient.BeginDelete // method. type ApplicationSecurityGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -318,34 +315,34 @@ type AzureFirewallFqdnTagsClientListAllOptions struct { // AzureFirewallsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureFirewallsClient.BeginCreateOrUpdate // method. type AzureFirewallsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureFirewallsClientBeginDeleteOptions contains the optional parameters for the AzureFirewallsClient.BeginDelete method. type AzureFirewallsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureFirewallsClientBeginListLearnedPrefixesOptions contains the optional parameters for the AzureFirewallsClient.BeginListLearnedPrefixes // method. type AzureFirewallsClientBeginListLearnedPrefixesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureFirewallsClientBeginPacketCaptureOptions contains the optional parameters for the AzureFirewallsClient.BeginPacketCapture // method. type AzureFirewallsClientBeginPacketCaptureOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureFirewallsClientBeginUpdateTagsOptions contains the optional parameters for the AzureFirewallsClient.BeginUpdateTags // method. type AzureFirewallsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -367,19 +364,19 @@ type AzureFirewallsClientListOptions struct { // BastionHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the BastionHostsClient.BeginCreateOrUpdate // method. type BastionHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // BastionHostsClientBeginDeleteOptions contains the optional parameters for the BastionHostsClient.BeginDelete method. type BastionHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // BastionHostsClientBeginUpdateTagsOptions contains the optional parameters for the BastionHostsClient.BeginUpdateTags method. type BastionHostsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -408,14 +405,14 @@ type BgpServiceCommunitiesClientListOptions struct { // ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginCreateOrUpdate // method. type ConfigurationPolicyGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConfigurationPolicyGroupsClientBeginDeleteOptions contains the optional parameters for the ConfigurationPolicyGroupsClient.BeginDelete // method. type ConfigurationPolicyGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -437,34 +434,20 @@ type ConnectionMonitorsClientBeginCreateOrUpdateOptions struct { // Value indicating whether connection monitor V1 should be migrated to V2 format. Migrate *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConnectionMonitorsClientBeginDeleteOptions contains the optional parameters for the ConnectionMonitorsClient.BeginDelete // method. type ConnectionMonitorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginQueryOptions contains the optional parameters for the ConnectionMonitorsClient.BeginQuery -// method. -type ConnectionMonitorsClientBeginQueryOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConnectionMonitorsClientBeginStartOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStart -// method. -type ConnectionMonitorsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConnectionMonitorsClientBeginStopOptions contains the optional parameters for the ConnectionMonitorsClient.BeginStop method. type ConnectionMonitorsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -491,7 +474,7 @@ type ConnectivityConfigurationsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -522,13 +505,13 @@ type ConnectivityConfigurationsClientListOptions struct { // CustomIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomIPPrefixesClient.BeginCreateOrUpdate // method. type CustomIPPrefixesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CustomIPPrefixesClientBeginDeleteOptions contains the optional parameters for the CustomIPPrefixesClient.BeginDelete method. type CustomIPPrefixesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -556,14 +539,14 @@ type CustomIPPrefixesClientUpdateTagsOptions struct { // DdosCustomPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginCreateOrUpdate // method. type DdosCustomPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DdosCustomPoliciesClientBeginDeleteOptions contains the optional parameters for the DdosCustomPoliciesClient.BeginDelete // method. type DdosCustomPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -581,14 +564,14 @@ type DdosCustomPoliciesClientUpdateTagsOptions struct { // DdosProtectionPlansClientBeginCreateOrUpdateOptions contains the optional parameters for the DdosProtectionPlansClient.BeginCreateOrUpdate // method. type DdosProtectionPlansClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DdosProtectionPlansClientBeginDeleteOptions contains the optional parameters for the DdosProtectionPlansClient.BeginDelete // method. type DdosProtectionPlansClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -628,14 +611,14 @@ type DefaultSecurityRulesClientListOptions struct { // DscpConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the DscpConfigurationClient.BeginCreateOrUpdate // method. type DscpConfigurationClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DscpConfigurationClientBeginDeleteOptions contains the optional parameters for the DscpConfigurationClient.BeginDelete // method. type DscpConfigurationClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -658,14 +641,14 @@ type DscpConfigurationClientListOptions struct { // ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginCreateOrUpdate // method. type ExpressRouteCircuitAuthorizationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitAuthorizationsClient.BeginDelete // method. type ExpressRouteCircuitAuthorizationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -684,14 +667,14 @@ type ExpressRouteCircuitAuthorizationsClientListOptions struct { // ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginCreateOrUpdate // method. type ExpressRouteCircuitConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitConnectionsClient.BeginDelete // method. type ExpressRouteCircuitConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -710,14 +693,14 @@ type ExpressRouteCircuitConnectionsClientListOptions struct { // ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginCreateOrUpdate // method. type ExpressRouteCircuitPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitPeeringsClient.BeginDelete // method. type ExpressRouteCircuitPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -736,35 +719,35 @@ type ExpressRouteCircuitPeeringsClientListOptions struct { // ExpressRouteCircuitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginCreateOrUpdate // method. type ExpressRouteCircuitsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginDelete // method. type ExpressRouteCircuitsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListArpTable // method. type ExpressRouteCircuitsClientBeginListArpTableOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTable // method. type ExpressRouteCircuitsClientBeginListRoutesTableOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCircuitsClient.BeginListRoutesTableSummary // method. type ExpressRouteCircuitsClientBeginListRoutesTableSummaryOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -806,14 +789,14 @@ type ExpressRouteCircuitsClientUpdateTagsOptions struct { // ExpressRouteConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginCreateOrUpdate // method. type ExpressRouteConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteConnectionsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteConnectionsClient.BeginDelete // method. type ExpressRouteConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -830,14 +813,14 @@ type ExpressRouteConnectionsClientListOptions struct { // ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginCreateOrUpdate // method. type ExpressRouteCrossConnectionPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions contains the optional parameters for the ExpressRouteCrossConnectionPeeringsClient.BeginDelete // method. type ExpressRouteCrossConnectionPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -856,28 +839,28 @@ type ExpressRouteCrossConnectionPeeringsClientListOptions struct { // ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginCreateOrUpdate // method. type ExpressRouteCrossConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCrossConnectionsClientBeginListArpTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListArpTable // method. type ExpressRouteCrossConnectionsClientBeginListArpTableOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTable // method. type ExpressRouteCrossConnectionsClientBeginListRoutesTableOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions contains the optional parameters for the ExpressRouteCrossConnectionsClient.BeginListRoutesTableSummary // method. type ExpressRouteCrossConnectionsClientBeginListRoutesTableSummaryOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -909,21 +892,21 @@ type ExpressRouteCrossConnectionsClientUpdateTagsOptions struct { // ExpressRouteGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginCreateOrUpdate // method. type ExpressRouteGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteGatewaysClientBeginDeleteOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginDelete // method. type ExpressRouteGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRouteGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the ExpressRouteGatewaysClient.BeginUpdateTags // method. type ExpressRouteGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -957,14 +940,14 @@ type ExpressRouteLinksClientListOptions struct { // ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginCreateOrUpdate // method. type ExpressRoutePortAuthorizationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRoutePortAuthorizationsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortAuthorizationsClient.BeginDelete // method. type ExpressRoutePortAuthorizationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -983,14 +966,14 @@ type ExpressRoutePortAuthorizationsClientListOptions struct { // ExpressRoutePortsClientBeginCreateOrUpdateOptions contains the optional parameters for the ExpressRoutePortsClient.BeginCreateOrUpdate // method. type ExpressRoutePortsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ExpressRoutePortsClientBeginDeleteOptions contains the optional parameters for the ExpressRoutePortsClient.BeginDelete // method. type ExpressRoutePortsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1049,13 +1032,13 @@ type ExpressRouteServiceProvidersClientListOptions struct { // FirewallPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPoliciesClient.BeginCreateOrUpdate // method. type FirewallPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the FirewallPoliciesClient.BeginDelete method. type FirewallPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1083,7 +1066,7 @@ type FirewallPoliciesClientUpdateTagsOptions struct { // FirewallPolicyDeploymentsClientBeginDeployOptions contains the optional parameters for the FirewallPolicyDeploymentsClient.BeginDeploy // method. type FirewallPolicyDeploymentsClientBeginDeployOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1160,14 +1143,14 @@ type FirewallPolicyRuleCollectionGroupDraftsClientGetOptions struct { // FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginCreateOrUpdate // method. type FirewallPolicyRuleCollectionGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions contains the optional parameters for the FirewallPolicyRuleCollectionGroupsClient.BeginDelete // method. type FirewallPolicyRuleCollectionGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1185,13 +1168,13 @@ type FirewallPolicyRuleCollectionGroupsClientListOptions struct { // FlowLogsClientBeginCreateOrUpdateOptions contains the optional parameters for the FlowLogsClient.BeginCreateOrUpdate method. type FlowLogsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // FlowLogsClientBeginDeleteOptions contains the optional parameters for the FlowLogsClient.BeginDelete method. type FlowLogsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1216,7 +1199,7 @@ type GroupsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1246,13 +1229,13 @@ type GroupsClientListOptions struct { // HubRouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the HubRouteTablesClient.BeginCreateOrUpdate // method. type HubRouteTablesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // HubRouteTablesClientBeginDeleteOptions contains the optional parameters for the HubRouteTablesClient.BeginDelete method. type HubRouteTablesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1269,14 +1252,14 @@ type HubRouteTablesClientListOptions struct { // HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginCreateOrUpdate // method. type HubVirtualNetworkConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // HubVirtualNetworkConnectionsClientBeginDeleteOptions contains the optional parameters for the HubVirtualNetworkConnectionsClient.BeginDelete // method. type HubVirtualNetworkConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1295,13 +1278,13 @@ type HubVirtualNetworkConnectionsClientListOptions struct { // IPAllocationsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPAllocationsClient.BeginCreateOrUpdate // method. type IPAllocationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // IPAllocationsClientBeginDeleteOptions contains the optional parameters for the IPAllocationsClient.BeginDelete method. type IPAllocationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1329,13 +1312,13 @@ type IPAllocationsClientUpdateTagsOptions struct { // IPGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the IPGroupsClient.BeginCreateOrUpdate method. type IPGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // IPGroupsClientBeginDeleteOptions contains the optional parameters for the IPGroupsClient.BeginDelete method. type IPGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1364,13 +1347,13 @@ type IPGroupsClientUpdateGroupsOptions struct { // InboundNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundNatRulesClient.BeginCreateOrUpdate // method. type InboundNatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // InboundNatRulesClientBeginDeleteOptions contains the optional parameters for the InboundNatRulesClient.BeginDelete method. type InboundNatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1388,7 +1371,7 @@ type InboundNatRulesClientListOptions struct { // InboundSecurityRuleClientBeginCreateOrUpdateOptions contains the optional parameters for the InboundSecurityRuleClient.BeginCreateOrUpdate // method. type InboundSecurityRuleClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1418,14 +1401,14 @@ type InterfaceLoadBalancersClientListOptions struct { // InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginCreateOrUpdate // method. type InterfaceTapConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // InterfaceTapConfigurationsClientBeginDeleteOptions contains the optional parameters for the InterfaceTapConfigurationsClient.BeginDelete // method. type InterfaceTapConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1444,27 +1427,27 @@ type InterfaceTapConfigurationsClientListOptions struct { // InterfacesClientBeginCreateOrUpdateOptions contains the optional parameters for the InterfacesClient.BeginCreateOrUpdate // method. type InterfacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // InterfacesClientBeginDeleteOptions contains the optional parameters for the InterfacesClient.BeginDelete method. type InterfacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // InterfacesClientBeginGetEffectiveRouteTableOptions contains the optional parameters for the InterfacesClient.BeginGetEffectiveRouteTable // method. type InterfacesClientBeginGetEffectiveRouteTableOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions contains the optional parameters for the InterfacesClient.BeginListEffectiveNetworkSecurityGroups // method. type InterfacesClientBeginListEffectiveNetworkSecurityGroupsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1543,13 +1526,13 @@ type InterfacesClientUpdateTagsOptions struct { // IpamPoolsClientBeginCreateOptions contains the optional parameters for the IpamPoolsClient.BeginCreate method. type IpamPoolsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // IpamPoolsClientBeginDeleteOptions contains the optional parameters for the IpamPoolsClient.BeginDelete method. type IpamPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1596,14 +1579,14 @@ type IpamPoolsClientUpdateOptions struct { // LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginCreateOrUpdate // method. type LoadBalancerBackendAddressPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LoadBalancerBackendAddressPoolsClientBeginDeleteOptions contains the optional parameters for the LoadBalancerBackendAddressPoolsClient.BeginDelete // method. type LoadBalancerBackendAddressPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1634,7 +1617,7 @@ type LoadBalancerFrontendIPConfigurationsClientListOptions struct { // LoadBalancerLoadBalancingRulesClientBeginHealthOptions contains the optional parameters for the LoadBalancerLoadBalancingRulesClient.BeginHealth // method. type LoadBalancerLoadBalancingRulesClientBeginHealthOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1681,27 +1664,27 @@ type LoadBalancerProbesClientListOptions struct { // LoadBalancersClientBeginCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.BeginCreateOrUpdate // method. type LoadBalancersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete method. type LoadBalancersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LoadBalancersClientBeginListInboundNatRulePortMappingsOptions contains the optional parameters for the LoadBalancersClient.BeginListInboundNatRulePortMappings // method. type LoadBalancersClientBeginListInboundNatRulePortMappingsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LoadBalancersClientBeginSwapPublicIPAddressesOptions contains the optional parameters for the LoadBalancersClient.BeginSwapPublicIPAddresses // method. type LoadBalancersClientBeginSwapPublicIPAddressesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1736,14 +1719,14 @@ type LoadBalancersClientUpdateTagsOptions struct { // LocalNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginCreateOrUpdate // method. type LocalNetworkGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LocalNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the LocalNetworkGatewaysClient.BeginDelete // method. type LocalNetworkGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1767,35 +1750,35 @@ type LocalNetworkGatewaysClientUpdateTagsOptions struct { // ManagementClientBeginDeleteBastionShareableLinkByTokenOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLinkByToken // method. type ManagementClientBeginDeleteBastionShareableLinkByTokenOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagementClientBeginDeleteBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginDeleteBastionShareableLink // method. type ManagementClientBeginDeleteBastionShareableLinkOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions contains the optional parameters for the // ManagementClient.BeginGeneratevirtualwanvpnserverconfigurationvpnprofile method. type ManagementClientBeginGeneratevirtualwanvpnserverconfigurationvpnprofileOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagementClientBeginGetActiveSessionsOptions contains the optional parameters for the ManagementClient.BeginGetActiveSessions // method. type ManagementClientBeginGetActiveSessionsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagementClientBeginPutBastionShareableLinkOptions contains the optional parameters for the ManagementClient.BeginPutBastionShareableLink // method. type ManagementClientBeginPutBastionShareableLinkOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1889,7 +1872,7 @@ type ManagementGroupNetworkManagerConnectionsClientListOptions struct { // ManagerCommitsClientBeginPostOptions contains the optional parameters for the ManagerCommitsClient.BeginPost method. type ManagerCommitsClientBeginPostOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1906,7 +1889,7 @@ type ManagerRoutingConfigurationsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1940,7 +1923,7 @@ type ManagersClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1985,13 +1968,13 @@ type ManagersClientPatchOptions struct { // NatGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the NatGatewaysClient.BeginCreateOrUpdate // method. type NatGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // NatGatewaysClientBeginDeleteOptions contains the optional parameters for the NatGatewaysClient.BeginDelete method. type NatGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2018,13 +2001,13 @@ type NatGatewaysClientUpdateTagsOptions struct { // NatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the NatRulesClient.BeginCreateOrUpdate method. type NatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // NatRulesClientBeginDeleteOptions contains the optional parameters for the NatRulesClient.BeginDelete method. type NatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2039,6 +2022,11 @@ type NatRulesClientListByVPNGatewayOptions struct { // placeholder for future optional parameters } +// NspAssociationReconcileClientPostOptions contains the optional parameters for the NspAssociationReconcileClient.Post method. +type NspAssociationReconcileClientPostOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -2047,54 +2035,54 @@ type OperationsClientListOptions struct { // P2SVPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginCreateOrUpdate // method. type P2SVPNGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete method. type P2SVPNGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDisconnectP2SVPNConnections // method. type P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGenerateVPNProfile // method. type P2SVPNGatewaysClientBeginGenerateVPNProfileOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealthDetailed // method. type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth // method. type P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset method. type P2SVPNGatewaysClientBeginResetOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // P2SVPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginUpdateTags // method. type P2SVPNGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2116,26 +2104,26 @@ type P2SVPNGatewaysClientListOptions struct { // PacketCapturesClientBeginCreateOptions contains the optional parameters for the PacketCapturesClient.BeginCreate method. type PacketCapturesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PacketCapturesClientBeginDeleteOptions contains the optional parameters for the PacketCapturesClient.BeginDelete method. type PacketCapturesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PacketCapturesClientBeginGetStatusOptions contains the optional parameters for the PacketCapturesClient.BeginGetStatus // method. type PacketCapturesClientBeginGetStatusOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PacketCapturesClientBeginStopOptions contains the optional parameters for the PacketCapturesClient.BeginStop method. type PacketCapturesClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2164,14 +2152,14 @@ type PeerExpressRouteCircuitConnectionsClientListOptions struct { // PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginCreateOrUpdate // method. type PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateDNSZoneGroupsClientBeginDeleteOptions contains the optional parameters for the PrivateDNSZoneGroupsClient.BeginDelete // method. type PrivateDNSZoneGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2189,13 +2177,13 @@ type PrivateDNSZoneGroupsClientListOptions struct { // PrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointsClient.BeginCreateOrUpdate // method. type PrivateEndpointsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete method. type PrivateEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2219,35 +2207,35 @@ type PrivateEndpointsClientListOptions struct { // PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions contains the optional parameters // for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibilityByResourceGroup method. type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility // method. type PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateLinkServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkServicesClient.BeginCreateOrUpdate // method. type PrivateLinkServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete // method. type PrivateLinkServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDeletePrivateEndpointConnection // method. type PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2301,7 +2289,7 @@ type PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions struct { // ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. type ProfilesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2334,21 +2322,21 @@ type ProfilesClientUpdateTagsOptions struct { // PublicIPAddressesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPAddressesClient.BeginCreateOrUpdate // method. type PublicIPAddressesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus // method. type PublicIPAddressesClientBeginDdosProtectionStatusOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete // method. type PublicIPAddressesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2415,13 +2403,13 @@ type PublicIPAddressesClientUpdateTagsOptions struct { // PublicIPPrefixesClientBeginCreateOrUpdateOptions contains the optional parameters for the PublicIPPrefixesClient.BeginCreateOrUpdate // method. type PublicIPPrefixesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete method. type PublicIPPrefixesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2486,7 +2474,7 @@ type ReachabilityAnalysisIntentsClientListOptions struct { // ReachabilityAnalysisRunsClientBeginDeleteOptions contains the optional parameters for the ReachabilityAnalysisRunsClient.BeginDelete // method. type ReachabilityAnalysisRunsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2528,13 +2516,13 @@ type ResourceNavigationLinksClientListOptions struct { // RouteFilterRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFilterRulesClient.BeginCreateOrUpdate // method. type RouteFilterRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RouteFilterRulesClientBeginDeleteOptions contains the optional parameters for the RouteFilterRulesClient.BeginDelete method. type RouteFilterRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2552,13 +2540,13 @@ type RouteFilterRulesClientListByRouteFilterOptions struct { // RouteFiltersClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteFiltersClient.BeginCreateOrUpdate // method. type RouteFiltersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete method. type RouteFiltersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2587,13 +2575,13 @@ type RouteFiltersClientUpdateTagsOptions struct { // RouteMapsClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteMapsClient.BeginCreateOrUpdate // method. type RouteMapsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RouteMapsClientBeginDeleteOptions contains the optional parameters for the RouteMapsClient.BeginDelete method. type RouteMapsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2610,13 +2598,13 @@ type RouteMapsClientListOptions struct { // RouteTablesClientBeginCreateOrUpdateOptions contains the optional parameters for the RouteTablesClient.BeginCreateOrUpdate // method. type RouteTablesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. type RouteTablesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2643,13 +2631,13 @@ type RouteTablesClientUpdateTagsOptions struct { // RoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutesClient.BeginCreateOrUpdate method. type RoutesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. type RoutesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2666,13 +2654,13 @@ type RoutesClientListOptions struct { // RoutingIntentClientBeginCreateOrUpdateOptions contains the optional parameters for the RoutingIntentClient.BeginCreateOrUpdate // method. type RoutingIntentClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RoutingIntentClientBeginDeleteOptions contains the optional parameters for the RoutingIntentClient.BeginDelete method. type RoutingIntentClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2693,7 +2681,7 @@ type RoutingRuleCollectionsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2726,7 +2714,7 @@ type RoutingRulesClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2785,7 +2773,7 @@ type SecurityAdminConfigurationsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2816,13 +2804,13 @@ type SecurityAdminConfigurationsClientListOptions struct { // SecurityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityGroupsClient.BeginCreateOrUpdate // method. type SecurityGroupsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete method. type SecurityGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2850,14 +2838,14 @@ type SecurityGroupsClientUpdateTagsOptions struct { // SecurityPartnerProvidersClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginCreateOrUpdate // method. type SecurityPartnerProvidersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete // method. type SecurityPartnerProvidersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2884,16 +2872,251 @@ type SecurityPartnerProvidersClientUpdateTagsOptions struct { // placeholder for future optional parameters } +// SecurityPerimeterAccessRulesClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.CreateOrUpdate +// method. +type SecurityPerimeterAccessRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAccessRulesClientDeleteOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Delete +// method. +type SecurityPerimeterAccessRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAccessRulesClientGetOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Get +// method. +type SecurityPerimeterAccessRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAccessRulesClientListOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.NewListPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimeterAccessRulesClientReconcileOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Reconcile +// method. +type SecurityPerimeterAccessRulesClientReconcileOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAssociableResourceTypesClientListOptions contains the optional parameters for the SecurityPerimeterAssociableResourceTypesClient.NewListPager +// method. +type SecurityPerimeterAssociableResourceTypesClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.BeginCreateOrUpdate +// method. +type SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// SecurityPerimeterAssociationsClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.BeginDelete +// method. +type SecurityPerimeterAssociationsClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// SecurityPerimeterAssociationsClientGetOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.Get +// method. +type SecurityPerimeterAssociationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterAssociationsClientListOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.NewListPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimeterLinkReferencesClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.BeginDelete +// method. +type SecurityPerimeterLinkReferencesClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// SecurityPerimeterLinkReferencesClientGetOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.Get +// method. +type SecurityPerimeterLinkReferencesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLinkReferencesClientListOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.NewListPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimeterLinksClientBeginDeleteOptions contains the optional parameters for the SecurityPerimeterLinksClient.BeginDelete +// method. +type SecurityPerimeterLinksClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// SecurityPerimeterLinksClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterLinksClient.CreateOrUpdate +// method. +type SecurityPerimeterLinksClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLinksClientGetOptions contains the optional parameters for the SecurityPerimeterLinksClient.Get method. +type SecurityPerimeterLinksClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLinksClientListOptions contains the optional parameters for the SecurityPerimeterLinksClient.NewListPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate +// method. +type SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLoggingConfigurationsClientDeleteOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.Delete +// method. +type SecurityPerimeterLoggingConfigurationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLoggingConfigurationsClientGetOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.Get +// method. +type SecurityPerimeterLoggingConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterLoggingConfigurationsClientListOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.NewListPager +// method. +type SecurityPerimeterLoggingConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterOperationStatusesClientGetOptions contains the optional parameters for the SecurityPerimeterOperationStatusesClient.Get +// method. +type SecurityPerimeterOperationStatusesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterProfilesClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterProfilesClient.CreateOrUpdate +// method. +type SecurityPerimeterProfilesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterProfilesClientDeleteOptions contains the optional parameters for the SecurityPerimeterProfilesClient.Delete +// method. +type SecurityPerimeterProfilesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterProfilesClientGetOptions contains the optional parameters for the SecurityPerimeterProfilesClient.Get +// method. +type SecurityPerimeterProfilesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimeterProfilesClientListOptions contains the optional parameters for the SecurityPerimeterProfilesClient.NewListPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimetersClientBeginDeleteOptions contains the optional parameters for the SecurityPerimetersClient.BeginDelete +// method. +type SecurityPerimetersClientBeginDeleteOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// SecurityPerimetersClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimetersClient.CreateOrUpdate +// method. +type SecurityPerimetersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimetersClientGetOptions contains the optional parameters for the SecurityPerimetersClient.Get method. +type SecurityPerimetersClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPerimetersClientListBySubscriptionOptions contains the optional parameters for the SecurityPerimetersClient.NewListBySubscriptionPager +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// 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. + SkipToken *string + + // An optional query parameter which specifies the maximum number of records to be returned by the server. + Top *int32 +} + +// SecurityPerimetersClientPatchOptions contains the optional parameters for the SecurityPerimetersClient.Patch method. +type SecurityPerimetersClientPatchOptions struct { + // placeholder for future optional parameters +} + // SecurityRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityRulesClient.BeginCreateOrUpdate // method. type SecurityRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecurityRulesClientBeginDeleteOptions contains the optional parameters for the SecurityRulesClient.BeginDelete method. type SecurityRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2914,7 +3137,7 @@ type SecurityUserConfigurationsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2949,7 +3172,7 @@ type SecurityUserRuleCollectionsClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -2984,7 +3207,7 @@ type SecurityUserRulesClientBeginDeleteOptions struct { // will do a cleanup deployment in the background, prior to the delete. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3018,14 +3241,14 @@ type ServiceAssociationLinksClientListOptions struct { // ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginCreateOrUpdate // method. type ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete // method. type ServiceEndpointPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3056,14 +3279,14 @@ type ServiceEndpointPoliciesClientUpdateTagsOptions struct { // ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginCreateOrUpdate // method. type ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.BeginDelete // method. type ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3096,7 +3319,7 @@ type ServiceTagsClientListOptions struct { // StaticCidrsClientBeginDeleteOptions contains the optional parameters for the StaticCidrsClient.BeginDelete method. type StaticCidrsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3157,27 +3380,27 @@ type StaticMembersClientListOptions struct { // SubnetsClientBeginCreateOrUpdateOptions contains the optional parameters for the SubnetsClient.BeginCreateOrUpdate method. type SubnetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SubnetsClientBeginDeleteOptions contains the optional parameters for the SubnetsClient.BeginDelete method. type SubnetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SubnetsClientBeginPrepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginPrepareNetworkPolicies // method. type SubnetsClientBeginPrepareNetworkPoliciesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SubnetsClientBeginUnprepareNetworkPoliciesOptions contains the optional parameters for the SubnetsClient.BeginUnprepareNetworkPolicies // method. type SubnetsClientBeginUnprepareNetworkPoliciesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3230,13 +3453,13 @@ type UsagesClientListOptions struct { // VPNConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNConnectionsClient.BeginCreateOrUpdate // method. type VPNConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNConnectionsClientBeginDeleteOptions contains the optional parameters for the VPNConnectionsClient.BeginDelete method. type VPNConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3246,7 +3469,7 @@ type VPNConnectionsClientBeginStartPacketCaptureOptions struct { // Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. Parameters *VPNConnectionPacketCaptureStartParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3256,7 +3479,7 @@ type VPNConnectionsClientBeginStopPacketCaptureOptions struct { // Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. Parameters *VPNConnectionPacketCaptureStopParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3274,13 +3497,13 @@ type VPNConnectionsClientListByVPNGatewayOptions struct { // VPNGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNGatewaysClient.BeginCreateOrUpdate // method. type VPNGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. type VPNGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3289,7 +3512,7 @@ type VPNGatewaysClientBeginResetOptions struct { // VpnGateway ipConfigurationId to specify the gateway instance. IPConfigurationID *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3299,7 +3522,7 @@ type VPNGatewaysClientBeginStartPacketCaptureOptions struct { // Vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. Parameters *VPNGatewayPacketCaptureStartParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3309,13 +3532,13 @@ type VPNGatewaysClientBeginStopPacketCaptureOptions struct { // Vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. Parameters *VPNGatewayPacketCaptureStopParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VPNGatewaysClient.BeginUpdateTags method. type VPNGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3338,21 +3561,21 @@ type VPNGatewaysClientListOptions struct { // VPNLinkConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginGetIkeSas // method. type VPNLinkConnectionsClientBeginGetIkeSasOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNLinkConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginResetConnection // method. type VPNLinkConnectionsClientBeginResetConnectionOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions contains the optional parameters for the VPNLinkConnectionsClient.BeginSetOrInitDefaultSharedKey // method. type VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3383,21 +3606,21 @@ type VPNLinkConnectionsClientListDefaultSharedKeyOptions struct { // VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList // method. type VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNServerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginCreateOrUpdate // method. type VPNServerConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete // method. type VPNServerConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3442,13 +3665,13 @@ type VPNSiteLinksClientListByVPNSiteOptions struct { // VPNSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VPNSitesClient.BeginCreateOrUpdate method. type VPNSitesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. type VPNSitesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3476,14 +3699,14 @@ type VPNSitesClientUpdateTagsOptions struct { // VPNSitesConfigurationClientBeginDownloadOptions contains the optional parameters for the VPNSitesConfigurationClient.BeginDownload // method. type VPNSitesConfigurationClientBeginDownloadOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VerifierWorkspacesClientBeginDeleteOptions contains the optional parameters for the VerifierWorkspacesClient.BeginDelete // method. type VerifierWorkspacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3523,7 +3746,7 @@ type VerifierWorkspacesClientUpdateOptions struct { // VipSwapClientBeginCreateOptions contains the optional parameters for the VipSwapClient.BeginCreate method. type VipSwapClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3540,14 +3763,14 @@ type VipSwapClientListOptions struct { // VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceConnectionsClient.BeginCreateOrUpdate // method. type VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualApplianceConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceConnectionsClient.BeginDelete // method. type VirtualApplianceConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3577,14 +3800,14 @@ type VirtualApplianceSKUsClientListOptions struct { // VirtualApplianceSitesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginCreateOrUpdate // method. type VirtualApplianceSitesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualApplianceSitesClientBeginDeleteOptions contains the optional parameters for the VirtualApplianceSitesClient.BeginDelete // method. type VirtualApplianceSitesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3602,14 +3825,31 @@ type VirtualApplianceSitesClientListOptions struct { // VirtualAppliancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualAppliancesClient.BeginCreateOrUpdate // method. type VirtualAppliancesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete // method. type VirtualAppliancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions contains the optional parameters for the VirtualAppliancesClient.BeginGetBootDiagnosticLogs +// method. +type VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualAppliancesClientBeginReimageOptions contains the optional parameters for the VirtualAppliancesClient.BeginReimage +// method. +type VirtualAppliancesClientBeginReimageOptions struct { + // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + NetworkVirtualApplianceInstanceIDs *VirtualApplianceInstanceIDs + + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3619,7 +3859,7 @@ type VirtualAppliancesClientBeginRestartOptions struct { // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. NetworkVirtualApplianceInstanceIDs *VirtualApplianceInstanceIDs - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3648,14 +3888,14 @@ type VirtualAppliancesClientUpdateTagsOptions struct { // VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginCreateOrUpdate // method. type VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubBgpConnectionClientBeginDeleteOptions contains the optional parameters for the VirtualHubBgpConnectionClient.BeginDelete // method. type VirtualHubBgpConnectionClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3667,14 +3907,14 @@ type VirtualHubBgpConnectionClientGetOptions struct { // VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListAdvertisedRoutes // method. type VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.BeginListLearnedRoutes // method. type VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3687,14 +3927,14 @@ type VirtualHubBgpConnectionsClientListOptions struct { // VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginCreateOrUpdate // method. type VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubIPConfigurationClientBeginDeleteOptions contains the optional parameters for the VirtualHubIPConfigurationClient.BeginDelete // method. type VirtualHubIPConfigurationClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3713,14 +3953,14 @@ type VirtualHubIPConfigurationClientListOptions struct { // VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginCreateOrUpdate // method. type VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubRouteTableV2SClientBeginDeleteOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.BeginDelete // method. type VirtualHubRouteTableV2SClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3738,13 +3978,13 @@ type VirtualHubRouteTableV2SClientListOptions struct { // VirtualHubsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualHubsClient.BeginCreateOrUpdate // method. type VirtualHubsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. type VirtualHubsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3754,21 +3994,21 @@ type VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions struct { // Parameters supplied to get the effective routes for a specific resource. EffectiveRoutesParameters *EffectiveRoutesParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubsClientBeginGetInboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetInboundRoutes // method. type VirtualHubsClientBeginGetInboundRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualHubsClientBeginGetOutboundRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetOutboundRoutes // method. type VirtualHubsClientBeginGetOutboundRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3796,42 +4036,42 @@ type VirtualHubsClientUpdateTagsOptions struct { // VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginCreateOrUpdate // method. type VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete // method. type VirtualNetworkGatewayConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas // method. type VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection // method. type VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetSharedKey // method. type VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginSetSharedKey // method. type VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3841,21 +4081,21 @@ type VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions struct // Virtual network gateway packet capture parameters supplied to start packet capture on gateway connection. Parameters *VPNPacketCaptureStartParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture // method. type VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginUpdateTags // method. type VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3880,14 +4120,14 @@ type VirtualNetworkGatewayConnectionsClientListOptions struct { // VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginCreateOrUpdate // method. type VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewayNatRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayNatRulesClient.BeginDelete // method. type VirtualNetworkGatewayNatRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3906,42 +4146,42 @@ type VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions struc // VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginCreateOrUpdate // method. type VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete // method. type VirtualNetworkGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions contains the optional parameters // for the VirtualNetworkGatewaysClient.BeginDisconnectVirtualNetworkGatewayVPNConnections method. type VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGenerateVPNProfile // method. type VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage // method. type VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes // method. type VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -3951,49 +4191,97 @@ type VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions struct { // The IP address of the peer to retrieve the status of. Peer *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetFailoverAllTestDetails // method. type VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails // method. type VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes // method. type VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetResiliencyInformation +// method. +type VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions struct { + // Attempt to recalculate the Resiliency Information for the gateway + AttemptRefresh *bool + + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetRoutesInformation +// method. +type VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions struct { + // Attempt to recalculate the Route Sets Information for the gateway + AttemptRefresh *bool + + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL // method. type VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth // method. type VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters // method. type VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeAbortMigration +// method. +type VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeCommitMigration +// method. +type VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration +// method. +type VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginInvokePrepareMigration +// method. +type VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4003,28 +4291,28 @@ type VirtualNetworkGatewaysClientBeginResetOptions struct { // Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. GatewayVip *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey // method. type VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginSetVpnclientIPSecParameters // method. type VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions contains the optional parameters for the // VirtualNetworkGatewaysClient.BeginStartExpressRouteSiteFailoverSimulation method. type VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4034,28 +4322,28 @@ type VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions struct { // Virtual network gateway packet capture parameters supplied to start packet capture on gateway. Parameters *VPNPacketCaptureStartParameters - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions contains the optional parameters for the // VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation method. type VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStopPacketCapture // method. type VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkGatewaysClientBeginUpdateTagsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginUpdateTags // method. type VirtualNetworkGatewaysClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4091,7 +4379,7 @@ type VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions struct { // VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginCreateOrUpdate // method. type VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string // Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. @@ -4101,7 +4389,7 @@ type VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions struct { // VirtualNetworkPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkPeeringsClient.BeginDelete // method. type VirtualNetworkPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4119,14 +4407,14 @@ type VirtualNetworkPeeringsClientListOptions struct { // VirtualNetworkTapsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginCreateOrUpdate // method. type VirtualNetworkTapsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete // method. type VirtualNetworkTapsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4156,20 +4444,20 @@ type VirtualNetworkTapsClientUpdateTagsOptions struct { // VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate // method. type VirtualNetworksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete method. type VirtualNetworksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus // method. type VirtualNetworksClientBeginListDdosProtectionStatusOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string // The skipToken that is given with nextLink. @@ -4215,14 +4503,14 @@ type VirtualNetworksClientUpdateTagsOptions struct { // VirtualRouterPeeringsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginCreateOrUpdate // method. type VirtualRouterPeeringsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualRouterPeeringsClientBeginDeleteOptions contains the optional parameters for the VirtualRouterPeeringsClient.BeginDelete // method. type VirtualRouterPeeringsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4240,13 +4528,13 @@ type VirtualRouterPeeringsClientListOptions struct { // VirtualRoutersClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualRoutersClient.BeginCreateOrUpdate // method. type VirtualRoutersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete method. type VirtualRoutersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4270,13 +4558,13 @@ type VirtualRoutersClientListOptions struct { // VirtualWansClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualWansClient.BeginCreateOrUpdate // method. type VirtualWansClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. type VirtualWansClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4304,81 +4592,81 @@ type VirtualWansClientUpdateTagsOptions struct { // WatchersClientBeginCheckConnectivityOptions contains the optional parameters for the WatchersClient.BeginCheckConnectivity // method. type WatchersClientBeginCheckConnectivityOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. type WatchersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetAzureReachabilityReportOptions contains the optional parameters for the WatchersClient.BeginGetAzureReachabilityReport // method. type WatchersClientBeginGetAzureReachabilityReportOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetFlowLogStatusOptions contains the optional parameters for the WatchersClient.BeginGetFlowLogStatus // method. type WatchersClientBeginGetFlowLogStatusOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetNetworkConfigurationDiagnosticOptions contains the optional parameters for the WatchersClient.BeginGetNetworkConfigurationDiagnostic // method. type WatchersClientBeginGetNetworkConfigurationDiagnosticOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetNextHopOptions contains the optional parameters for the WatchersClient.BeginGetNextHop method. type WatchersClientBeginGetNextHopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetTroubleshootingOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshooting // method. type WatchersClientBeginGetTroubleshootingOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetTroubleshootingResultOptions contains the optional parameters for the WatchersClient.BeginGetTroubleshootingResult // method. type WatchersClientBeginGetTroubleshootingResultOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginGetVMSecurityRulesOptions contains the optional parameters for the WatchersClient.BeginGetVMSecurityRules // method. type WatchersClientBeginGetVMSecurityRulesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginListAvailableProvidersOptions contains the optional parameters for the WatchersClient.BeginListAvailableProviders // method. type WatchersClientBeginListAvailableProvidersOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginSetFlowLogConfigurationOptions contains the optional parameters for the WatchersClient.BeginSetFlowLogConfiguration // method. type WatchersClientBeginSetFlowLogConfigurationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // WatchersClientBeginVerifyIPFlowOptions contains the optional parameters for the WatchersClient.BeginVerifyIPFlow method. type WatchersClientBeginVerifyIPFlowOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -4415,7 +4703,7 @@ type WatchersClientUpdateTagsOptions struct { // WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete // method. type WebApplicationFirewallPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go index c0d4c7f563e1..8916aab2a43f 100644 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to create or Update a virtual wan p2s vpn gateway. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, options *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters P2SVPNGateway, _ *P2SVPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *P2SVPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginDeleteOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *P2SVPNGatewaysClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *P2SVPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +203,7 @@ func (client *P2SVPNGatewaysClient) deleteCreateRequest(ctx context.Context, res // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - p2SVPNGatewayName - The name of the P2S Vpn Gateway. // - request - The parameters are supplied to disconnect p2s vpn connections. @@ -234,7 +231,7 @@ func (client *P2SVPNGatewaysClient) BeginDisconnectP2SVPNConnections(ctx context // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -257,7 +254,7 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnections(ctx context.Cont } // disconnectP2SVPNConnectionsCreateRequest creates the DisconnectP2SVPNConnections request. -func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, options *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, p2SVPNGatewayName string, request P2SVPNConnectionRequest, _ *P2SVPNGatewaysClientBeginDisconnectP2SVPNConnectionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -276,7 +273,7 @@ func (client *P2SVPNGatewaysClient) disconnectP2SVPNConnectionsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -288,7 +285,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - parameters - Parameters supplied to the generate P2SVpnGateway VPN client package operation. @@ -315,7 +312,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -338,7 +335,7 @@ 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, options *P2SVPNGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -357,7 +354,7 @@ func (client *P2SVPNGatewaysClient) generateVPNProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -369,7 +366,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientGetOptions contains the optional parameters for the P2SVPNGatewaysClient.Get method. @@ -396,7 +393,7 @@ func (client *P2SVPNGatewaysClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientGetOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *P2SVPNGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -415,7 +412,7 @@ func (client *P2SVPNGatewaysClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +431,7 @@ func (client *P2SVPNGatewaysClient) getHandleResponse(resp *http.Response) (P2SV // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth @@ -461,7 +458,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealth(ctx context.C // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginGetP2SVPNConnectionHealth" @@ -484,7 +481,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealth(ctx context.Contex } // getP2SVPNConnectionHealthCreateRequest creates the GetP2SVPNConnectionHealth request. -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -503,7 +500,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -513,7 +510,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthCreateRequest(ctx c // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the P2SVpnGateway. // - request - Request parameters supplied to get p2s vpn connections detailed health. @@ -541,7 +538,7 @@ func (client *P2SVPNGatewaysClient) BeginGetP2SVPNConnectionHealthDetailed(ctx c // wan P2SVpnGateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -564,7 +561,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailed(ctx contex } // getP2SVPNConnectionHealthDetailedCreateRequest creates the GetP2SVPNConnectionHealthDetailed request. -func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, options *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVPNConnectionHealthRequest, _ *P2SVPNGatewaysClientBeginGetP2SVPNConnectionHealthDetailedOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -583,7 +580,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -594,7 +591,7 @@ func (client *P2SVPNGatewaysClient) getP2SVPNConnectionHealthDetailedCreateReque // NewListPager - Lists all the P2SVpnGateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -620,7 +617,7 @@ func (client *P2SVPNGatewaysClient) NewListPager(options *P2SVPNGatewaysClientLi } // listCreateRequest creates the List request. -func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, options *P2SVPNGatewaysClientListOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, _ *P2SVPNGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -631,7 +628,7 @@ func (client *P2SVPNGatewaysClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -648,7 +645,7 @@ func (client *P2SVPNGatewaysClient) listHandleResponse(resp *http.Response) (P2S // NewListByResourceGroupPager - Lists all the P2SVpnGateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - options - P2SVPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the P2SVPNGatewaysClient.NewListByResourceGroupPager // method. @@ -676,7 +673,7 @@ func (client *P2SVPNGatewaysClient) NewListByResourceGroupPager(resourceGroupNam } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *P2SVPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *P2SVPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -691,7 +688,7 @@ func (client *P2SVPNGatewaysClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -709,7 +706,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - options - P2SVPNGatewaysClientBeginResetOptions contains the optional parameters for the P2SVPNGatewaysClient.BeginReset @@ -735,7 +732,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "P2SVPNGatewaysClient.BeginReset" @@ -758,7 +755,7 @@ func (client *P2SVPNGatewaysClient) reset(ctx context.Context, resourceGroupName } // resetCreateRequest creates the Reset request. -func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *P2SVPNGatewaysClientBeginResetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -777,7 +774,7 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -786,7 +783,7 @@ func (client *P2SVPNGatewaysClient) resetCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates virtual wan p2s vpn gateway tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the P2SVpnGateway. // - gatewayName - The name of the gateway. // - p2SVPNGatewayParameters - Parameters supplied to update a virtual wan p2s vpn gateway tags. @@ -813,7 +810,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -836,7 +833,7 @@ func (client *P2SVPNGatewaysClient) updateTags(ctx context.Context, resourceGrou } // updateTagsCreateRequest creates the UpdateTags request. -func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, options *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { +func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, p2SVPNGatewayParameters TagsObject, _ *P2SVPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -855,7 +852,7 @@ func (client *P2SVPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, p2SVPNGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go deleted file mode 100644 index 7e099526eaea..000000000000 --- a/sdk/resourcemanager/network/armnetwork/p2svpngateways_client_example_test.go +++ /dev/null @@ -1,1079 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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("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\\"), - // 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), - // }, - // }}, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, - }, nil) - if 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.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")}, - // 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(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), - // }, - // }}, - // 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{ - // }, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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")}, - // 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/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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginDelete(ctx, "rg1", "p2sVpnGateway1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewP2SVPNGatewaysClient().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.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")}, - // 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/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"), - // }, - // }, - // }, - // { - // 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"), - // 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")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/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/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewP2SVPNGatewaysClient().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.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")}, - // 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/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"), - // }, - // }, - // }, - // { - // 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")}, - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // VirtualHub: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/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/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewP2SVPNGatewaysClient().BeginReset(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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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(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), - // }, - // }}, - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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(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), - // }, - // }}, - // 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/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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 8a09e93337b0..48adaf5a3ac6 100644 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go +++ b/sdk/resourcemanager/network/armnetwork/packetcaptures_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *PacketCapturesClientBeginCreateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *PacketCapturesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *PacketCapturesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *PacketCapturesClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a packet capture session by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -243,7 +240,7 @@ 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, options *PacketCapturesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -266,7 +263,7 @@ func (client *PacketCapturesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -311,7 +308,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -334,7 +331,7 @@ 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, options *PacketCapturesClientBeginGetStatusOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -357,7 +354,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +362,7 @@ func (client *PacketCapturesClient) getStatusCreateRequest(ctx context.Context, // NewListPager - Lists all packet capture sessions within the specified resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the Network Watcher resource. // - options - PacketCapturesClientListOptions contains the optional parameters for the PacketCapturesClient.NewListPager method. @@ -394,7 +391,7 @@ func (client *PacketCapturesClient) NewListPager(resourceGroupName string, netwo } // listCreateRequest creates the List request. -func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *PacketCapturesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -413,7 +410,7 @@ func (client *PacketCapturesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +428,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - packetCaptureName - The name of the packet capture session. @@ -458,7 +455,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -481,7 +478,7 @@ 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, options *PacketCapturesClientBeginStopOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -504,7 +501,7 @@ func (client *PacketCapturesClient) stopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} 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 deleted file mode 100644 index 3ee356eb0bf8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/packetcaptures_client_example_test.go +++ /dev/null @@ -1,246 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginCreate(ctx, "rg1", "nw1", "pc1", armnetwork.PacketCapture{ - Properties: &armnetwork.PacketCaptureParameters{ - 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), - }, - }, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - } - _, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPacketCapturesClient().BeginGetStatus(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 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.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{ - // }, - // PacketCaptureStatus: to.Ptr(armnetwork.PcStatusStopped), - // StopReason: to.Ptr("TimeExceeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPacketCapturesClient().NewListPager("rg1", "nw1", 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.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"), - // }, - // 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{ - // }, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go index d9877b7ee7af..4d9044bf715e 100644 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the express route circuit. // - peeringName - The name of the peering. @@ -77,7 +74,7 @@ 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, options *PeerExpressRouteCircuitConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -104,7 +101,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +118,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - circuitName - The name of the circuit. // - peeringName - The name of the peering. @@ -151,7 +148,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) NewListPager(resourceGro } // listCreateRequest creates the List request. -func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, options *PeerExpressRouteCircuitConnectionsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -174,7 +171,7 @@ func (client *PeerExpressRouteCircuitConnectionsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 14763ad8ca70..000000000000 --- a/sdk/resourcemanager/network/armnetwork/peerexpressroutecircuitconnections_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPeerExpressRouteCircuitConnectionsClient().Get(ctx, "rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "60aee347-e889-4a42-8c1b-0aae8b1e4013", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPeerExpressRouteCircuitConnectionsClient().NewListPager("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", 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.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"), - // }, - // 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"), - // }, - // 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 9895db9365ce..9a5287914232 100644 --- a/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go +++ b/sdk/resourcemanager/network/armnetwork/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go index ae477806a730..7deb197f2c16 100644 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *PrivateDNSZoneGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *PrivateDNSZoneGroupsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *PrivateDNSZoneGroupsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *PrivateDNSZoneGroupsClient) deleteCreateRequest(ctx context.Contex // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - privateDNSZoneGroupName - The name of the private dns zone group. @@ -244,7 +241,7 @@ 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, options *PrivateDNSZoneGroupsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *PrivateDNSZoneGroupsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *PrivateDNSZoneGroupsClient) getHandleResponse(resp *http.Response) // NewListPager - Gets all private dns zone groups in a private endpoint. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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 @@ -313,7 +310,7 @@ func (client *PrivateDNSZoneGroupsClient) NewListPager(privateEndpointName strin } // listCreateRequest creates the List request. -func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, privateEndpointName string, resourceGroupName string, options *PrivateDNSZoneGroupsClientListOptions) (*policy.Request, error) { +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 privateEndpointName == "" { return nil, errors.New("parameter privateEndpointName cannot be empty") @@ -332,7 +329,7 @@ func (client *PrivateDNSZoneGroupsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 46086e99d0bc..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privatednszonegroups_client_example_test.go +++ /dev/null @@ -1,253 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateDNSZoneGroupsClient().BeginDelete(ctx, "rg1", "testPe", "testPdnsgroup", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateDNSZoneGroupsClient().Get(ctx, "rg1", "testPe", "testPdnsgroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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")}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateDNSZoneGroupsClient().NewListPager("testPe", "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.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")}, - // 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), - // }, - // }, - // { - // 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"), - // }}, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go index 3484c42b97bc..c207f675a4df 100644 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go +++ b/sdk/resourcemanager/network/armnetwork/privateendpoints_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - parameters - Parameters supplied to the create or update private endpoint operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *PrivateEndpointsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *PrivateEndpointsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *PrivateEndpointsClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, privateEndpointName string, options *PrivateEndpointsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *PrivateEndpointsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified private endpoint by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - privateEndpointName - The name of the private endpoint. // - options - PrivateEndpointsClientGetOptions contains the optional parameters for the PrivateEndpointsClient.Get method. @@ -254,7 +251,7 @@ func (client *PrivateEndpointsClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *PrivateEndpointsClient) getHandleResponse(resp *http.Response) (Pr // NewListPager - Gets all private endpoints in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PrivateEndpointsClientListOptions contains the optional parameters for the PrivateEndpointsClient.NewListPager // method. @@ -299,7 +296,7 @@ func (client *PrivateEndpointsClient) NewListPager(resourceGroupName string, opt } // listCreateRequest creates the List request. -func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateEndpointsClientListOptions) (*policy.Request, error) { +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") @@ -314,7 +311,7 @@ func (client *PrivateEndpointsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *PrivateEndpointsClient) listHandleResponse(resp *http.Response) (P // NewListBySubscriptionPager - Gets all private endpoints in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PrivateEndpointsClientListBySubscriptionOptions contains the optional parameters for the PrivateEndpointsClient.NewListBySubscriptionPager // method. func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *PrivateEndpointsClientListBySubscriptionOptions) *runtime.Pager[PrivateEndpointsClientListBySubscriptionResponse] { @@ -358,7 +355,7 @@ func (client *PrivateEndpointsClient) NewListBySubscriptionPager(options *Privat } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateEndpointsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *PrivateEndpointsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *PrivateEndpointsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 715b527688d4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privateendpoints_client_example_test.go +++ /dev/null @@ -1,941 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointsClient().BeginDelete(ctx, "rg1", "testPe", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // { - // 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/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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // }, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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")}, - // }, - // { - // 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"), - // }, - // }}, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - 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"), - }, - }}, - PrivateLinkServiceConnections: []*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."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) - if 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.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")}, - // }, - // { - // 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{ - // }, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - Properties: &armnetwork.PrivateEndpointProperties{ - ApplicationSecurityGroups: []*armnetwork.ApplicationSecurityGroup{ - { - ID: to.Ptr("/subscriptions/subId/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"), - RequestMessage: to.Ptr("Please approve my connection."), - }, - }}, - Subnet: &armnetwork.Subnet{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - }, - }, - }, nil) - if 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.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")}, - // }, - // { - // Fqdn: to.Ptr("abc2.cosmos.com"), - // IPAddresses: []*string{ - // to.Ptr("192.168.0.5")}, - // }}, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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{ - // }, - // 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"), - // }, - // }}, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointsClient().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.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")}, - // }, - // { - // 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"), - // }, - // }, - // { - // 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/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"), - // }, - // }, - // }, - // { - // 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{ - // }, - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointsClient().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.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")}, - // }, - // { - // 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"), - // }, - // }, - // { - // 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/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"), - // }, - // }, - // }, - // { - // 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{ - // }, - // 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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go index fcde434e96b3..b738fd0cf1e3 100644 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go +++ b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - parameters - The request body of CheckPrivateLinkService API call. // - options - PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions contains the optional parameters for the @@ -73,7 +70,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginCheckPrivateLinkServiceVisibility" @@ -96,7 +93,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibility(ctx c } // checkPrivateLinkServiceVisibilityCreateRequest creates the CheckPrivateLinkServiceVisibility request. -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreateRequest(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityOptions) (*policy.Request, error) { +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") @@ -111,7 +108,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -124,7 +121,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityCreate // in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - parameters - The request body of CheckPrivateLinkService API call. @@ -152,7 +149,7 @@ func (client *PrivateLinkServicesClient) BeginCheckPrivateLinkServiceVisibilityB // the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -175,7 +172,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso } // checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest creates the CheckPrivateLinkServiceVisibilityByResourceGroup request. -func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest, options *PrivateLinkServicesClientBeginCheckPrivateLinkServiceVisibilityByResourceGroupOptions) (*policy.Request, error) { +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 location == "" { return nil, errors.New("parameter location cannot be empty") @@ -194,7 +191,7 @@ func (client *PrivateLinkServicesClient) checkPrivateLinkServiceVisibilityByReso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -206,7 +203,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - parameters - Parameters supplied to the create or update private link service operation. @@ -233,7 +230,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -256,7 +253,7 @@ 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, options *PrivateLinkServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -275,7 +272,7 @@ func (client *PrivateLinkServicesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -287,7 +284,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkServicesClient.BeginDelete @@ -313,7 +310,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateLinkServicesClient.BeginDelete" @@ -336,7 +333,7 @@ func (client *PrivateLinkServicesClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -355,7 +352,7 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +361,7 @@ func (client *PrivateLinkServicesClient) deleteCreateRequest(ctx context.Context // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -391,7 +388,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -414,7 +411,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnection(ctx con } // deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. -func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, options *PrivateLinkServicesClientBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -437,7 +434,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +443,7 @@ func (client *PrivateLinkServicesClient) deletePrivateEndpointConnectionCreateRe // Get - Gets the specified private link service by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientGetOptions contains the optional parameters for the PrivateLinkServicesClient.Get method. @@ -495,7 +492,7 @@ func (client *PrivateLinkServicesClient) getCreateRequest(ctx context.Context, r if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -514,7 +511,7 @@ func (client *PrivateLinkServicesClient) getHandleResponse(resp *http.Response) // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -569,7 +566,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -586,7 +583,7 @@ func (client *PrivateLinkServicesClient) getPrivateEndpointConnectionHandleRespo // NewListPager - Gets all private link services in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPager // method. @@ -614,7 +611,7 @@ func (client *PrivateLinkServicesClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PrivateLinkServicesClientListOptions) (*policy.Request, error) { +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") @@ -629,7 +626,7 @@ func (client *PrivateLinkServicesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -647,7 +644,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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions contains the optional parameters for the // PrivateLinkServicesClient.NewListAutoApprovedPrivateLinkServicesPager method. @@ -675,7 +672,7 @@ func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesP } // listAutoApprovedPrivateLinkServicesCreateRequest creates the ListAutoApprovedPrivateLinkServices request. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCreateRequest(ctx context.Context, location string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesOptions) (*policy.Request, error) { +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") @@ -690,7 +687,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -708,7 +705,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location of the domain name. // - resourceGroupName - The name of the resource group. // - options - PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions contains the optional parameters @@ -737,7 +734,7 @@ func (client *PrivateLinkServicesClient) NewListAutoApprovedPrivateLinkServicesB } // listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest creates the ListAutoApprovedPrivateLinkServicesByResourceGroup request. -func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupCreateRequest(ctx context.Context, location string, resourceGroupName string, options *PrivateLinkServicesClientListAutoApprovedPrivateLinkServicesByResourceGroupOptions) (*policy.Request, error) { +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 location == "" { return nil, errors.New("parameter location cannot be empty") @@ -756,7 +753,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -773,7 +770,7 @@ func (client *PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByRe // NewListBySubscriptionPager - Gets all private link service in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PrivateLinkServicesClientListBySubscriptionOptions contains the optional parameters for the PrivateLinkServicesClient.NewListBySubscriptionPager // method. func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *PrivateLinkServicesClientListBySubscriptionOptions) *runtime.Pager[PrivateLinkServicesClientListBySubscriptionResponse] { @@ -800,7 +797,7 @@ func (client *PrivateLinkServicesClient) NewListBySubscriptionPager(options *Pri } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *PrivateLinkServicesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *PrivateLinkServicesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -811,7 +808,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +825,7 @@ func (client *PrivateLinkServicesClient) listBySubscriptionHandleResponse(resp * // NewListPrivateEndpointConnectionsPager - Gets all private end point connections for a specific private link service. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - options - PrivateLinkServicesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the PrivateLinkServicesClient.NewListPrivateEndpointConnectionsPager @@ -857,7 +854,7 @@ func (client *PrivateLinkServicesClient) NewListPrivateEndpointConnectionsPager( } // listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. -func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateLinkServicesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -876,7 +873,7 @@ func (client *PrivateLinkServicesClient) listPrivateEndpointConnectionsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +891,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceName - The name of the private link service. // - peConnectionName - The name of the private end point connection. @@ -924,7 +921,7 @@ 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, options *PrivateLinkServicesClientUpdatePrivateEndpointConnectionOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -947,7 +944,7 @@ func (client *PrivateLinkServicesClient) updatePrivateEndpointConnectionCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go b/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go deleted file mode 100644 index 3d689692f566..000000000000 --- a/sdk/resourcemanager/network/armnetwork/privatelinkservices_client_example_test.go +++ /dev/null @@ -1,798 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDelete(ctx, "rg1", "testPls", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkServicesClient().Get(ctx, "rg1", "testPls", &armnetwork.PrivateLinkServicesClientGetOptions{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.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")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginCreateOrUpdate(ctx, "rg1", "testPls", armnetwork.PrivateLinkService{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.PrivateLinkServiceProperties{ - 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("fe-lb"), - 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"), - }}, - Visibility: &armnetwork.PrivateLinkServicePropertiesVisibility{ - Subscriptions: []*string{ - to.Ptr("subscription1"), - to.Ptr("subscription2"), - to.Ptr("subscription3")}, - }, - }, - }, nil) - if 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.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")}, - // }, - // 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"), - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkServicesClient().GetPrivateEndpointConnection(ctx, "rg1", "testPls", "testPlePeConnection", &armnetwork.PrivateLinkServicesClientGetPrivateEndpointConnectionOptions{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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateLinkServicesClient().BeginDeletePrivateEndpointConnection(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkServicesClient().NewListPrivateEndpointConnectionsPager("rg1", "testPls", 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.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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %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.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"), - // }, - // { - // PrivateLinkService: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls3"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client.go b/sdk/resourcemanager/network/armnetwork/profiles_client.go index 734324a37a60..ac27a8b6cacd 100644 --- a/sdk/resourcemanager/network/armnetwork/profiles_client.go +++ b/sdk/resourcemanager/network/armnetwork/profiles_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the network profile. // - parameters - Parameters supplied to the create or update network profile operation. @@ -75,7 +72,7 @@ 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, options *ProfilesClientCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *ProfilesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +112,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the NetworkProfile. // - options - ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. @@ -140,7 +137,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -163,7 +160,7 @@ func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkProfileName string, options *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -182,7 +179,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +188,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the public IP prefix. // - options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. @@ -240,7 +237,7 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +254,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl // NewListPager - Gets all network profiles in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. func (client *ProfilesClient) NewListPager(resourceGroupName string, options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { @@ -284,7 +281,7 @@ func (client *ProfilesClient) NewListPager(resourceGroupName string, options *Pr } // listCreateRequest creates the List request. -func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ProfilesClientListOptions) (*policy.Request, error) { +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") @@ -299,7 +296,7 @@ func (client *ProfilesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +313,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListAllPager - Gets all the network profiles in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -342,7 +339,7 @@ func (client *ProfilesClient) NewListAllPager(options *ProfilesClientListAllOpti } // listAllCreateRequest creates the ListAll request. -func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options *ProfilesClientListAllOptions) (*policy.Request, error) { +func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, _ *ProfilesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -353,7 +350,7 @@ func (client *ProfilesClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +368,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkProfileName - The name of the network profile. // - parameters - Parameters supplied to update network profile tags. @@ -399,7 +396,7 @@ 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, options *ProfilesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -418,7 +415,7 @@ func (client *ProfilesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go b/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go deleted file mode 100644 index b79ff4e58a6a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/profiles_client_example_test.go +++ /dev/null @@ -1,684 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginDelete(ctx, "rg1", "networkProfile1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{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.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"), - // }, - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "rg1", "networkProfile1", &armnetwork.ProfilesClientGetOptions{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.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"), - // }, - // { - // 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"), - // }, - // }, - // }, - // { - // 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"), - // }, - // }, - // }}, - // 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"), - // }, - // { - // 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"), - // }, - // }, - // }}, - // 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), - // }, - // }, - // { - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().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.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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().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.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"), - // }, - // }, - // }, - // { - // 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), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // 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"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // ContainerNetworkInterfaces: []*armnetwork.ContainerNetworkInterface{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go index 68faf568be47..aec2db2edf55 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddress_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go index e1ba5dbc7fb2..7cdd5f27a866 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to the create or update public IP address operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *PublicIPAddressesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *PublicIPAddressesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDdosProtectionStatusOptions contains the optional parameters for the PublicIPAddressesClient.BeginDdosProtectionStatus @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDdosProtectionStatus" @@ -177,7 +174,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatus(ctx context.Context, } // ddosProtectionStatusCreateRequest creates the DdosProtectionStatus request. -func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDdosProtectionStatusOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *PublicIPAddressesClient) ddosProtectionStatusCreateRequest(ctx con // BeginDelete - Deletes the specified public IP address. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientBeginDeleteOptions contains the optional parameters for the PublicIPAddressesClient.BeginDelete @@ -231,7 +228,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPAddressesClient.BeginDelete" @@ -254,7 +251,7 @@ func (client *PublicIPAddressesClient) deleteOperation(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPAddressName string, options *PublicIPAddressesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -273,7 +270,7 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +279,7 @@ func (client *PublicIPAddressesClient) deleteCreateRequest(ctx context.Context, // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - options - PublicIPAddressesClientGetOptions contains the optional parameters for the PublicIPAddressesClient.Get method. @@ -331,7 +328,7 @@ func (client *PublicIPAddressesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +346,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The role instance name. @@ -419,7 +416,7 @@ func (client *PublicIPAddressesClient) getCloudServicePublicIPAddressCreateReque if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,7 +521,7 @@ func (client *PublicIPAddressesClient) getVirtualMachineScaleSetPublicIPAddressH // NewListPager - Gets all public IP addresses in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPAddressesClientListOptions contains the optional parameters for the PublicIPAddressesClient.NewListPager // method. @@ -552,7 +549,7 @@ func (client *PublicIPAddressesClient) NewListPager(resourceGroupName string, op } // listCreateRequest creates the List request. -func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPAddressesClientListOptions) (*policy.Request, error) { +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") @@ -567,7 +564,7 @@ func (client *PublicIPAddressesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -584,7 +581,7 @@ func (client *PublicIPAddressesClient) listHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the public IP addresses in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PublicIPAddressesClientListAllOptions contains the optional parameters for the PublicIPAddressesClient.NewListAllPager // method. func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddressesClientListAllOptions) *runtime.Pager[PublicIPAddressesClientListAllResponse] { @@ -611,7 +608,7 @@ func (client *PublicIPAddressesClient) NewListAllPager(options *PublicIPAddresse } // listAllCreateRequest creates the ListAll request. -func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, options *PublicIPAddressesClientListAllOptions) (*policy.Request, error) { +func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, _ *PublicIPAddressesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -622,7 +619,7 @@ func (client *PublicIPAddressesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -639,7 +636,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - options - PublicIPAddressesClientListCloudServicePublicIPAddressesOptions contains the optional parameters for the PublicIPAddressesClient.NewListCloudServicePublicIPAddressesPager @@ -668,7 +665,7 @@ func (client *PublicIPAddressesClient) NewListCloudServicePublicIPAddressesPager } // listCloudServicePublicIPAddressesCreateRequest creates the ListCloudServicePublicIPAddresses request. -func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *PublicIPAddressesClientListCloudServicePublicIPAddressesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -687,7 +684,7 @@ func (client *PublicIPAddressesClient) listCloudServicePublicIPAddressesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -705,7 +702,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - cloudServiceName - The name of the cloud service. // - roleInstanceName - The name of role instance. @@ -737,7 +734,7 @@ 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, options *PublicIPAddressesClientListCloudServiceRoleInstancePublicIPAddressesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -768,7 +765,7 @@ func (client *PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -815,7 +812,7 @@ func (client *PublicIPAddressesClient) NewListVirtualMachineScaleSetPublicIPAddr } // listVirtualMachineScaleSetPublicIPAddressesCreateRequest creates the ListVirtualMachineScaleSetPublicIPAddresses request. -func (client *PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *PublicIPAddressesClientListVirtualMachineScaleSetPublicIPAddressesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -884,7 +881,7 @@ 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, options *PublicIPAddressesClientListVirtualMachineScaleSetVMPublicIPAddressesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -933,7 +930,7 @@ func (client *PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddre // UpdateTags - Updates public IP address tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPAddressName - The name of the public IP address. // - parameters - Parameters supplied to update public IP address tags. @@ -962,7 +959,7 @@ 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, options *PublicIPAddressesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -981,7 +978,7 @@ func (client *PublicIPAddressesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go deleted file mode 100644 index 303a6de2adc2..000000000000 --- a/sdk/resourcemanager/network/armnetwork/publicipaddresses_client_example_test.go +++ /dev/null @@ -1,863 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPublicIPAddressesClient().GetCloudServicePublicIPAddress(ctx, "cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetCloudServicePublicIPAddressOptions{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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPAddressesClient().BeginDelete(ctx, "rg1", "test-ip", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/PublicIpAddressGet.json -func ExamplePublicIPAddressesClient_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.NewPublicIPAddressesClient().Get(ctx, "rg1", "testDNS-ip", &armnetwork.PublicIPAddressesClientGetOptions{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.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"), - // }, - // ProtectionMode: to.Ptr(armnetwork.DdosSettingsProtectionModeEnabled), - // }, - // 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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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{ - DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - DomainNameLabel: to.Ptr("dnslbl"), - }, - }, - }, nil) - if 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("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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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{ - DNSSettings: &armnetwork.PublicIPAddressDNSSettings{ - DomainNameLabel: to.Ptr("dnslbl"), - DomainNameLabelScope: to.Ptr(armnetwork.PublicIPAddressDNSSettingsDomainNameLabelScopeTenantReuse), - }, - }, - }, nil) - if 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("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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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("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), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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("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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPAddressesClient().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.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"), - // }, - // 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"), - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 { - 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("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"), - // }, - // { - // 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"), - // }, - // 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"), - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssPublicIpListAll.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetPublicIPAddressesPager() { - cred, err := 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().NewListVirtualMachineScaleSetPublicIPAddressesPager("vmss-tester", "vmss1", 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/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"), - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssVmPublicIpList.json -func ExamplePublicIPAddressesClient_NewListVirtualMachineScaleSetVMPublicIPAddressesPager() { - cred, err := 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().NewListVirtualMachineScaleSetVMPublicIPAddressesPager("vmss-tester", "vmss1", "1", "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/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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VmssPublicIpGet.json -func ExamplePublicIPAddressesClient_GetVirtualMachineScaleSetPublicIPAddress() { - cred, err := 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().GetVirtualMachineScaleSetPublicIPAddress(ctx, "vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", &armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions{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.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"), - // }, - // 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"), - // }, - // 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 7df729195a85..18c01d4c0336 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefix_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go index 14115bb1df1f..b24166603a86 100644 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go +++ b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to the create or update public IP prefix operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *PublicIPPrefixesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *PublicIPPrefixesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the PublicIpPrefix. // - options - PublicIPPrefixesClientBeginDeleteOptions contains the optional parameters for the PublicIPPrefixesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PublicIPPrefixesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *PublicIPPrefixesClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, publicIPPrefixName string, options *PublicIPPrefixesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *PublicIPPrefixesClient) deleteCreateRequest(ctx context.Context, r // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - options - PublicIPPrefixesClientGetOptions contains the optional parameters for the PublicIPPrefixesClient.Get method. @@ -254,7 +251,7 @@ func (client *PublicIPPrefixesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *PublicIPPrefixesClient) getHandleResponse(resp *http.Response) (Pu // NewListPager - Gets all public IP prefixes in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - PublicIPPrefixesClientListOptions contains the optional parameters for the PublicIPPrefixesClient.NewListPager // method. @@ -299,7 +296,7 @@ func (client *PublicIPPrefixesClient) NewListPager(resourceGroupName string, opt } // listCreateRequest creates the List request. -func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PublicIPPrefixesClientListOptions) (*policy.Request, error) { +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") @@ -314,7 +311,7 @@ func (client *PublicIPPrefixesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *PublicIPPrefixesClient) listHandleResponse(resp *http.Response) (P // NewListAllPager - Gets all the public IP prefixes in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - PublicIPPrefixesClientListAllOptions contains the optional parameters for the PublicIPPrefixesClient.NewListAllPager // method. func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesClientListAllOptions) *runtime.Pager[PublicIPPrefixesClientListAllResponse] { @@ -358,7 +355,7 @@ func (client *PublicIPPrefixesClient) NewListAllPager(options *PublicIPPrefixesC } // listAllCreateRequest creates the ListAll request. -func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, options *PublicIPPrefixesClientListAllOptions) (*policy.Request, error) { +func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, _ *PublicIPPrefixesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *PublicIPPrefixesClient) listAllCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +384,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - publicIPPrefixName - The name of the public IP prefix. // - parameters - Parameters supplied to update public IP prefix tags. @@ -416,7 +413,7 @@ 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, options *PublicIPPrefixesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -435,7 +432,7 @@ func (client *PublicIPPrefixesClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go b/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go deleted file mode 100644 index 7710dcf2437b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/publicipprefixes_client_example_test.go +++ /dev/null @@ -1,399 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPublicIPPrefixesClient().BeginDelete(ctx, "rg1", "test-ipprefix", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/PublicIpPrefixGet.json -func ExamplePublicIPPrefixesClient_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.NewPublicIPPrefixesClient().Get(ctx, "rg1", "test-ipprefix", &armnetwork.PublicIPPrefixesClientGetOptions{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.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), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - }, - 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) - } - 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPPrefixesClient().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.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{ - // }, - // 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{ - // }, - // 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{ - // }, - // LoadBalancerFrontendIPConfiguration: &armnetwork.SubResource{ - // ID: to.Ptr("/subscriptions/subid/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: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPublicIPPrefixesClient().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.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), - // }, - // }, - // { - // 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{ - // }, - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go index 1bce960b699e..9860442a85e4 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -79,7 +76,7 @@ func (client *ReachabilityAnalysisIntentsClient) Create(ctx context.Context, res } // createCreateRequest creates the Create request. -func (client *ReachabilityAnalysisIntentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, body ReachabilityAnalysisIntent, options *ReachabilityAnalysisIntentsClientCreateOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisIntentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, body ReachabilityAnalysisIntent, _ *ReachabilityAnalysisIntentsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisIntents/{reachabilityAnalysisIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *ReachabilityAnalysisIntentsClient) createCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +124,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -156,7 +153,7 @@ func (client *ReachabilityAnalysisIntentsClient) Delete(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, options *ReachabilityAnalysisIntentsClientDeleteOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, _ *ReachabilityAnalysisIntentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisIntents/{reachabilityAnalysisIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -183,7 +180,7 @@ func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +189,7 @@ func (client *ReachabilityAnalysisIntentsClient) deleteCreateRequest(ctx context // Get - Get the Reachability Analysis Intent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -222,7 +219,7 @@ func (client *ReachabilityAnalysisIntentsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ReachabilityAnalysisIntentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, options *ReachabilityAnalysisIntentsClientGetOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisIntentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisIntentName string, _ *ReachabilityAnalysisIntentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisIntents/{reachabilityAnalysisIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -249,7 +246,7 @@ func (client *ReachabilityAnalysisIntentsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +263,7 @@ func (client *ReachabilityAnalysisIntentsClient) getHandleResponse(resp *http.Re // NewListPager - Gets list of Reachability Analysis Intents . // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -319,7 +316,7 @@ func (client *ReachabilityAnalysisIntentsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go deleted file mode 100644 index 2da71ec0e014..000000000000 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisintents_client_example_test.go +++ /dev/null @@ -1,220 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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")}, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go index cb4cc839e2c4..493e7cf90d9d 100644 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go +++ b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -79,7 +76,7 @@ func (client *ReachabilityAnalysisRunsClient) Create(ctx context.Context, resour } // createCreateRequest creates the Create request. -func (client *ReachabilityAnalysisRunsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, body ReachabilityAnalysisRun, options *ReachabilityAnalysisRunsClientCreateOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisRunsClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, body ReachabilityAnalysisRun, _ *ReachabilityAnalysisRunsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisRuns/{reachabilityAnalysisRunName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *ReachabilityAnalysisRunsClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +124,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 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" @@ -178,7 +175,7 @@ func (client *ReachabilityAnalysisRunsClient) deleteOperation(ctx context.Contex } // deleteCreateRequest creates the Delete request. -func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, options *ReachabilityAnalysisRunsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, _ *ReachabilityAnalysisRunsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisRuns/{reachabilityAnalysisRunName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -205,7 +202,7 @@ func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *ReachabilityAnalysisRunsClient) deleteCreateRequest(ctx context.Co // Get - Gets Reachability Analysis Run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -244,7 +241,7 @@ func (client *ReachabilityAnalysisRunsClient) Get(ctx context.Context, resourceG } // getCreateRequest creates the Get request. -func (client *ReachabilityAnalysisRunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, options *ReachabilityAnalysisRunsClientGetOptions) (*policy.Request, error) { +func (client *ReachabilityAnalysisRunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, reachabilityAnalysisRunName string, _ *ReachabilityAnalysisRunsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/verifierWorkspaces/{workspaceName}/reachabilityAnalysisRuns/{reachabilityAnalysisRunName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -271,7 +268,7 @@ func (client *ReachabilityAnalysisRunsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +285,7 @@ func (client *ReachabilityAnalysisRunsClient) getHandleResponse(resp *http.Respo // NewListPager - Gets list of Reachability Analysis Runs. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -341,7 +338,7 @@ func (client *ReachabilityAnalysisRunsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go b/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go deleted file mode 100644 index 085e53625c29..000000000000 --- a/sdk/resourcemanager/network/armnetwork/reachabilityanalysisruns_client_example_test.go +++ /dev/null @@ -1,222 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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"), - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go index 5ffadc70787b..4eece585a108 100644 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -76,7 +73,7 @@ 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, options *ResourceNavigationLinksClientListOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *ResourceNavigationLinksClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index f3679e27d81c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/resourcenavigationlinks_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceNavigationLinksClient().List(ctx, "rg1", "vnet", "subnet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/responses.go b/sdk/resourcemanager/network/armnetwork/responses.go index 2ff4a9232d5c..cb4282ad24f7 100644 --- a/sdk/resourcemanager/network/armnetwork/responses.go +++ b/sdk/resourcemanager/network/armnetwork/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -8,8 +5,6 @@ package armnetwork -import "encoding/json" - // AdminRuleCollectionsClientCreateOrUpdateResponse contains the response from method AdminRuleCollectionsClient.CreateOrUpdate. type AdminRuleCollectionsClientCreateOrUpdateResponse struct { // Defines the admin rule collection. @@ -39,16 +34,6 @@ type AdminRulesClientCreateOrUpdateResponse struct { BaseAdminRuleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientCreateOrUpdateResponse. -func (a *AdminRulesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalBaseAdminRuleClassification(data) - if err != nil { - return err - } - a.BaseAdminRuleClassification = res - return nil -} - // AdminRulesClientDeleteResponse contains the response from method AdminRulesClient.BeginDelete. type AdminRulesClientDeleteResponse struct { // placeholder for future response values @@ -60,16 +45,6 @@ type AdminRulesClientGetResponse struct { BaseAdminRuleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientGetResponse. -func (a *AdminRulesClientGetResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalBaseAdminRuleClassification(data) - if err != nil { - return err - } - a.BaseAdminRuleClassification = res - return nil -} - // AdminRulesClientListResponse contains the response from method AdminRulesClient.NewListPager. type AdminRulesClientListResponse struct { // security configuration admin rule list result. @@ -435,17 +410,6 @@ type ConnectionMonitorsClientListResponse struct { ConnectionMonitorListResult } -// ConnectionMonitorsClientQueryResponse contains the response from method ConnectionMonitorsClient.BeginQuery. -type ConnectionMonitorsClientQueryResponse struct { - // List of connection states snapshots. - ConnectionMonitorQueryResult -} - -// ConnectionMonitorsClientStartResponse contains the response from method ConnectionMonitorsClient.BeginStart. -type ConnectionMonitorsClientStartResponse struct { - // placeholder for future response values -} - // ConnectionMonitorsClientStopResponse contains the response from method ConnectionMonitorsClient.BeginStop. type ConnectionMonitorsClientStopResponse struct { // placeholder for future response values @@ -1899,6 +1863,12 @@ type NatRulesClientListByVPNGatewayResponse struct { ListVPNGatewayNatRulesResult } +// NspAssociationReconcileClientPostResponse contains the response from method NspAssociationReconcileClient.Post. +type NspAssociationReconcileClientPostResponse struct { + // Anything + Interface any +} + // 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 @@ -2670,6 +2640,198 @@ type SecurityPartnerProvidersClientUpdateTagsResponse struct { SecurityPartnerProvider } +// SecurityPerimeterAccessRulesClientCreateOrUpdateResponse contains the response from method SecurityPerimeterAccessRulesClient.CreateOrUpdate. +type SecurityPerimeterAccessRulesClientCreateOrUpdateResponse struct { + // The NSP access rule resource + NspAccessRule +} + +// SecurityPerimeterAccessRulesClientDeleteResponse contains the response from method SecurityPerimeterAccessRulesClient.Delete. +type SecurityPerimeterAccessRulesClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterAccessRulesClientGetResponse contains the response from method SecurityPerimeterAccessRulesClient.Get. +type SecurityPerimeterAccessRulesClientGetResponse struct { + // The NSP access rule resource + NspAccessRule +} + +// 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. + 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. + PerimeterAssociableResourcesListResult +} + +// SecurityPerimeterAssociationsClientCreateOrUpdateResponse contains the response from method SecurityPerimeterAssociationsClient.BeginCreateOrUpdate. +type SecurityPerimeterAssociationsClientCreateOrUpdateResponse struct { + // The NSP resource association resource + NspAssociation +} + +// SecurityPerimeterAssociationsClientDeleteResponse contains the response from method SecurityPerimeterAssociationsClient.BeginDelete. +type SecurityPerimeterAssociationsClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterAssociationsClientGetResponse contains the response from method SecurityPerimeterAssociationsClient.Get. +type SecurityPerimeterAssociationsClientGetResponse struct { + // The NSP resource association resource + NspAssociation +} + +// 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. + NspAssociationsListResult +} + +// SecurityPerimeterLinkReferencesClientDeleteResponse contains the response from method SecurityPerimeterLinkReferencesClient.BeginDelete. +type SecurityPerimeterLinkReferencesClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterLinkReferencesClientGetResponse contains the response from method SecurityPerimeterLinkReferencesClient.Get. +type SecurityPerimeterLinkReferencesClientGetResponse struct { + // The network security perimeter linkReference resource + NspLinkReference +} + +// 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. + NspLinkReferenceListResult +} + +// SecurityPerimeterLinksClientCreateOrUpdateResponse contains the response from method SecurityPerimeterLinksClient.CreateOrUpdate. +type SecurityPerimeterLinksClientCreateOrUpdateResponse struct { + // The network security perimeter link resource + NspLink +} + +// SecurityPerimeterLinksClientDeleteResponse contains the response from method SecurityPerimeterLinksClient.BeginDelete. +type SecurityPerimeterLinksClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterLinksClientGetResponse contains the response from method SecurityPerimeterLinksClient.Get. +type SecurityPerimeterLinksClientGetResponse struct { + // The network security perimeter link resource + NspLink +} + +// 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. + NspLinkListResult +} + +// SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse contains the response from method SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate. +type SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse struct { + // The NSP logging configuration + NspLoggingConfiguration +} + +// SecurityPerimeterLoggingConfigurationsClientDeleteResponse contains the response from method SecurityPerimeterLoggingConfigurationsClient.Delete. +type SecurityPerimeterLoggingConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterLoggingConfigurationsClientGetResponse contains the response from method SecurityPerimeterLoggingConfigurationsClient.Get. +type SecurityPerimeterLoggingConfigurationsClientGetResponse struct { + // The NSP logging configuration + NspLoggingConfiguration +} + +// 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. + NspLoggingConfigurationListResult +} + +// SecurityPerimeterOperationStatusesClientGetResponse contains the response from method SecurityPerimeterOperationStatusesClient.Get. +type SecurityPerimeterOperationStatusesClientGetResponse struct { + // The current status of an async operation. + OperationStatusResult +} + +// SecurityPerimeterProfilesClientCreateOrUpdateResponse contains the response from method SecurityPerimeterProfilesClient.CreateOrUpdate. +type SecurityPerimeterProfilesClientCreateOrUpdateResponse struct { + // The network security perimeter profile resource + NspProfile +} + +// SecurityPerimeterProfilesClientDeleteResponse contains the response from method SecurityPerimeterProfilesClient.Delete. +type SecurityPerimeterProfilesClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimeterProfilesClientGetResponse contains the response from method SecurityPerimeterProfilesClient.Get. +type SecurityPerimeterProfilesClientGetResponse struct { + // The network security perimeter profile resource + NspProfile +} + +// 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. + NspProfileListResult +} + +// SecurityPerimetersClientCreateOrUpdateResponse contains the response from method SecurityPerimetersClient.CreateOrUpdate. +type SecurityPerimetersClientCreateOrUpdateResponse struct { + // The Network Security Perimeter resource + SecurityPerimeter +} + +// SecurityPerimetersClientDeleteResponse contains the response from method SecurityPerimetersClient.BeginDelete. +type SecurityPerimetersClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityPerimetersClientGetResponse contains the response from method SecurityPerimetersClient.Get. +type SecurityPerimetersClientGetResponse struct { + // The Network Security Perimeter resource + SecurityPerimeter +} + +// 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. + 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. + SecurityPerimeterListResult +} + +// SecurityPerimetersClientPatchResponse contains the response from method SecurityPerimetersClient.Patch. +type SecurityPerimetersClientPatchResponse struct { + // The Network Security Perimeter resource + SecurityPerimeter +} + // SecurityRulesClientCreateOrUpdateResponse contains the response from method SecurityRulesClient.BeginCreateOrUpdate. type SecurityRulesClientCreateOrUpdateResponse struct { // Network security rule. @@ -2976,21 +3138,11 @@ type VPNConnectionsClientStartPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStartPacketCaptureResponse. -func (v *VPNConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VPNConnectionsClientStopPacketCaptureResponse contains the response from method VPNConnectionsClient.BeginStopPacketCapture. type VPNConnectionsClientStopPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStopPacketCaptureResponse. -func (v *VPNConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VPNGatewaysClientCreateOrUpdateResponse contains the response from method VPNGatewaysClient.BeginCreateOrUpdate. type VPNGatewaysClientCreateOrUpdateResponse struct { // VpnGateway Resource. @@ -3033,21 +3185,11 @@ type VPNGatewaysClientStartPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStartPacketCaptureResponse. -func (v *VPNGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VPNGatewaysClientStopPacketCaptureResponse contains the response from method VPNGatewaysClient.BeginStopPacketCapture. type VPNGatewaysClientStopPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStopPacketCaptureResponse. -func (v *VPNGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VPNGatewaysClientUpdateTagsResponse contains the response from method VPNGatewaysClient.BeginUpdateTags. type VPNGatewaysClientUpdateTagsResponse struct { // VpnGateway Resource. @@ -3071,11 +3213,6 @@ type VPNLinkConnectionsClientGetIkeSasResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkConnectionsClientGetIkeSasResponse. -func (v *VPNLinkConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VPNLinkConnectionsClientListByVPNConnectionResponse contains the response from method VPNLinkConnectionsClient.NewListByVPNConnectionPager. type VPNLinkConnectionsClientListByVPNConnectionResponse struct { // Result of the request to list all vpn connections to a virtual wan vpn gateway. It contains a list of Vpn Connections and @@ -3317,6 +3454,11 @@ type VirtualAppliancesClientDeleteResponse struct { // placeholder for future response values } +// VirtualAppliancesClientGetBootDiagnosticLogsResponse contains the response from method VirtualAppliancesClient.BeginGetBootDiagnosticLogs. +type VirtualAppliancesClientGetBootDiagnosticLogsResponse struct { + VirtualApplianceInstanceID +} + // VirtualAppliancesClientGetResponse contains the response from method VirtualAppliancesClient.Get. type VirtualAppliancesClientGetResponse struct { // NetworkVirtualAppliance Resource. @@ -3335,6 +3477,12 @@ type VirtualAppliancesClientListResponse struct { VirtualApplianceListResult } +// VirtualAppliancesClientReimageResponse contains the response from method VirtualAppliancesClient.BeginReimage. +type VirtualAppliancesClientReimageResponse struct { + // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + VirtualApplianceInstanceIDs +} + // VirtualAppliancesClientRestartResponse contains the response from method VirtualAppliancesClient.BeginRestart. type VirtualAppliancesClientRestartResponse struct { // Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. @@ -3370,22 +3518,12 @@ type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse struct { Value map[string][]*PeerRoute } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse. -func (v *VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // 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 } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubBgpConnectionsClientListLearnedRoutesResponse. -func (v *VirtualHubBgpConnectionsClientListLearnedRoutesResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualHubBgpConnectionsClientListResponse contains the response from method VirtualHubBgpConnectionsClient.NewListPager. type VirtualHubBgpConnectionsClientListResponse struct { // VirtualHubBgpConnections list. @@ -3509,11 +3647,6 @@ type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse. -func (v *VirtualNetworkGatewayConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewayConnectionsClientGetResponse contains the response from method VirtualNetworkGatewayConnectionsClient.Get. type VirtualNetworkGatewayConnectionsClientGetResponse struct { // A common class for general resource information. @@ -3554,21 +3687,11 @@ type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse. -func (v *VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginStopPacketCapture. type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse. -func (v *VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewayConnectionsClientUpdateTagsResponse contains the response from method VirtualNetworkGatewayConnectionsClient.BeginUpdateTags. type VirtualNetworkGatewayConnectionsClientUpdateTagsResponse struct { // A common class for general resource information. @@ -3620,21 +3743,11 @@ type VirtualNetworkGatewaysClientGenerateVPNProfileResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGenerateVPNProfileResponse. -func (v *VirtualNetworkGatewaysClientGenerateVPNProfileResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse contains the response from method VirtualNetworkGatewaysClient.BeginGeneratevpnclientpackage. type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse. -func (v *VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetAdvertisedRoutes. type VirtualNetworkGatewaysClientGetAdvertisedRoutesResponse struct { // List of virtual network gateway routes. @@ -3653,44 +3766,41 @@ type VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse struct { ExpressRouteFailoverTestDetailsArray []*ExpressRouteFailoverTestDetails } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse. -func (v *VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.ExpressRouteFailoverTestDetailsArray) -} - // VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetFailoverSingleTestDetails. type VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse struct { // Gateway Failover Single Test Details Object ExpressRouteFailoverSingleTestDetailsArray []*ExpressRouteFailoverSingleTestDetails } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse. -func (v *VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.ExpressRouteFailoverSingleTestDetailsArray) -} - // VirtualNetworkGatewaysClientGetLearnedRoutesResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetLearnedRoutes. type VirtualNetworkGatewaysClientGetLearnedRoutesResponse struct { // List of virtual network gateway routes. GatewayRouteListResult } +// VirtualNetworkGatewaysClientGetResiliencyInformationResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetResiliencyInformation. +type VirtualNetworkGatewaysClientGetResiliencyInformationResponse struct { + // Gateway Resiliency Information + GatewayResiliencyInformation +} + // VirtualNetworkGatewaysClientGetResponse contains the response from method VirtualNetworkGatewaysClient.Get. type VirtualNetworkGatewaysClientGetResponse struct { // A common class for general resource information. VirtualNetworkGateway } +// VirtualNetworkGatewaysClientGetRoutesInformationResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetRoutesInformation. +type VirtualNetworkGatewaysClientGetRoutesInformationResponse struct { + // Gateway Route Sets Information + GatewayRouteSetsInformation +} + // VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL. type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse. -func (v *VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse contains the response from method VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth. type VirtualNetworkGatewaysClientGetVpnclientConnectionHealthResponse struct { // List of virtual network gateway vpn client connection health. @@ -3703,6 +3813,26 @@ type VirtualNetworkGatewaysClientGetVpnclientIPSecParametersResponse struct { VPNClientIPsecParameters } +// VirtualNetworkGatewaysClientInvokeAbortMigrationResponse contains the response from method VirtualNetworkGatewaysClient.BeginInvokeAbortMigration. +type VirtualNetworkGatewaysClientInvokeAbortMigrationResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientInvokeCommitMigrationResponse contains the response from method VirtualNetworkGatewaysClient.BeginInvokeCommitMigration. +type VirtualNetworkGatewaysClientInvokeCommitMigrationResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse contains the response from method VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration. +type VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse struct { + // placeholder for future response values +} + +// VirtualNetworkGatewaysClientInvokePrepareMigrationResponse contains the response from method VirtualNetworkGatewaysClient.BeginInvokePrepareMigration. +type VirtualNetworkGatewaysClientInvokePrepareMigrationResponse struct { + // placeholder for future response values +} + // VirtualNetworkGatewaysClientListConnectionsResponse contains the response from method VirtualNetworkGatewaysClient.NewListConnectionsPager. type VirtualNetworkGatewaysClientListConnectionsResponse struct { // Response for the VirtualNetworkGatewayListConnections API service call. @@ -3737,41 +3867,21 @@ type VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse. -func (v *VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientStartPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.BeginStartPacketCapture. type VirtualNetworkGatewaysClientStartPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartPacketCaptureResponse. -func (v *VirtualNetworkGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse contains the response from method VirtualNetworkGatewaysClient.BeginStopExpressRouteSiteFailoverSimulation. type VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse. -func (v *VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientStopPacketCaptureResponse contains the response from method VirtualNetworkGatewaysClient.BeginStopPacketCapture. type VirtualNetworkGatewaysClientStopPacketCaptureResponse struct { Value *string } -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopPacketCaptureResponse. -func (v *VirtualNetworkGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, &v.Value) -} - // VirtualNetworkGatewaysClientSupportedVPNDevicesResponse contains the response from method VirtualNetworkGatewaysClient.SupportedVPNDevices. type VirtualNetworkGatewaysClientSupportedVPNDevicesResponse struct { Value *string diff --git a/sdk/resourcemanager/network/armnetwork/responses_serde.go b/sdk/resourcemanager/network/armnetwork/responses_serde.go new file mode 100644 index 000000000000..dbcb4ca9c70c --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/responses_serde.go @@ -0,0 +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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armnetwork + +import "encoding/json" + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientCreateOrUpdateResponse. +func (a *AdminRulesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalBaseAdminRuleClassification(data) + if err != nil { + return err + } + a.BaseAdminRuleClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdminRulesClientGetResponse. +func (a *AdminRulesClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalBaseAdminRuleClassification(data) + if err != nil { + return err + } + a.BaseAdminRuleClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStartPacketCaptureResponse. +func (v *VPNConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNConnectionsClientStopPacketCaptureResponse. +func (v *VPNConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStartPacketCaptureResponse. +func (v *VPNGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNGatewaysClientStopPacketCaptureResponse. +func (v *VPNGatewaysClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VPNLinkConnectionsClientGetIkeSasResponse. +func (v *VPNLinkConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse. +func (v *VirtualHubBgpConnectionsClientListAdvertisedRoutesResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHubBgpConnectionsClientListLearnedRoutesResponse. +func (v *VirtualHubBgpConnectionsClientListLearnedRoutesResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientGetIkeSasResponse. +func (v *VirtualNetworkGatewayConnectionsClientGetIkeSasResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse. +func (v *VirtualNetworkGatewayConnectionsClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse. +func (v *VirtualNetworkGatewayConnectionsClientStopPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGenerateVPNProfileResponse. +func (v *VirtualNetworkGatewaysClientGenerateVPNProfileResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse. +func (v *VirtualNetworkGatewaysClientGeneratevpnclientpackageResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse. +func (v *VirtualNetworkGatewaysClientGetFailoverAllTestDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.ExpressRouteFailoverTestDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse. +func (v *VirtualNetworkGatewaysClientGetFailoverSingleTestDetailsResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.ExpressRouteFailoverSingleTestDetailsArray) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse. +func (v *VirtualNetworkGatewaysClientGetVPNProfilePackageURLResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse. +func (v *VirtualNetworkGatewaysClientStartExpressRouteSiteFailoverSimulationResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStartPacketCaptureResponse. +func (v *VirtualNetworkGatewaysClientStartPacketCaptureResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse. +func (v *VirtualNetworkGatewaysClientStopExpressRouteSiteFailoverSimulationResponse) UnmarshalJSON(data []byte) error { + return json.Unmarshal(data, &v.Value) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkGatewaysClientStopPacketCaptureResponse. +func (v *VirtualNetworkGatewaysClientStopPacketCaptureResponse) 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 ba54a5e0e1d2..19a9a7964cbf 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilterrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the route filter rule. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *RouteFilterRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *RouteFilterRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterRuleParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *RouteFilterRulesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *RouteFilterRulesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the specified rule from a route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - ruleName - The name of the rule. @@ -243,7 +240,7 @@ 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, options *RouteFilterRulesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -266,7 +263,7 @@ func (client *RouteFilterRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ func (client *RouteFilterRulesClient) getHandleResponse(resp *http.Response) (Ro // NewListByRouteFilterPager - Gets all RouteFilterRules in a route filter. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFilterRulesClientListByRouteFilterOptions contains the optional parameters for the RouteFilterRulesClient.NewListByRouteFilterPager @@ -312,7 +309,7 @@ func (client *RouteFilterRulesClient) NewListByRouteFilterPager(resourceGroupNam } // listByRouteFilterCreateRequest creates the ListByRouteFilter request. -func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFilterRulesClientListByRouteFilterOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -331,7 +328,7 @@ func (client *RouteFilterRulesClient) listByRouteFilterCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7cb35ca96c60..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routefilterrules_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFilterRulesClient().BeginDelete(ctx, "rg1", "filterName", "ruleName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRouteFilterRulesClient().Get(ctx, "rg1", "filterName", "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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFilterRulesClient().NewListByRouteFilterPager("rg1", "filterName", 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.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")}, - // 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 02c564a75af6..11c7dde855ee 100644 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client.go +++ b/sdk/resourcemanager/network/armnetwork/routefilters_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - routeFilterParameters - Parameters supplied to the create or update route filter operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *RouteFiltersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *RouteFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeFilterParameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientBeginDeleteOptions contains the optional parameters for the RouteFiltersClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteFiltersClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *RouteFiltersClient) deleteOperation(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeFilterName string, options *RouteFiltersClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *RouteFiltersClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified route filter. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - options - RouteFiltersClientGetOptions contains the optional parameters for the RouteFiltersClient.Get method. @@ -254,7 +251,7 @@ func (client *RouteFiltersClient) getCreateRequest(ctx context.Context, resource if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *RouteFiltersClient) getHandleResponse(resp *http.Response) (RouteF // NewListPager - Gets all route filters in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -297,7 +294,7 @@ func (client *RouteFiltersClient) NewListPager(options *RouteFiltersClientListOp } // listCreateRequest creates the List request. -func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options *RouteFiltersClientListOptions) (*policy.Request, error) { +func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, _ *RouteFiltersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -308,7 +305,7 @@ func (client *RouteFiltersClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +322,7 @@ func (client *RouteFiltersClient) listHandleResponse(resp *http.Response) (Route // NewListByResourceGroupPager - Gets all route filters in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - RouteFiltersClientListByResourceGroupOptions contains the optional parameters for the RouteFiltersClient.NewListByResourceGroupPager // method. @@ -353,7 +350,7 @@ func (client *RouteFiltersClient) NewListByResourceGroupPager(resourceGroupName } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *RouteFiltersClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -368,7 +365,7 @@ func (client *RouteFiltersClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeFilterName - The name of the route filter. // - parameters - Parameters supplied to update route filter tags. @@ -414,7 +411,7 @@ 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, options *RouteFiltersClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -433,7 +430,7 @@ func (client *RouteFiltersClient) updateTagsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go deleted file mode 100644 index 92e026c3dc16..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routefilters_client_example_test.go +++ /dev/null @@ -1,326 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteFiltersClient().BeginDelete(ctx, "rg1", "filterName", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFiltersClient().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.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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteFiltersClient().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.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")}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // RouteFilterRuleType: to.Ptr(armnetwork.RouteFilterRuleTypeCommunity), - // }, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routemaps_client.go b/sdk/resourcemanager/network/armnetwork/routemaps_client.go index 95ae4730bced..262f1c8f897a 100644 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/routemaps_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *RouteMapsClient) createOrUpdate(ctx context.Context, resourceGroup } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, options *RouteMapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap, _ *RouteMapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *RouteMapsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeMapParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -182,7 +179,7 @@ func (client *RouteMapsClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, _ *RouteMapsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -205,7 +202,7 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *RouteMapsClient) deleteCreateRequest(ctx context.Context, resource // Get - Retrieves the details of a RouteMap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -242,7 +239,7 @@ func (client *RouteMapsClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, options *RouteMapsClientGetOptions) (*policy.Request, error) { +func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, _ *RouteMapsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -265,7 +262,7 @@ func (client *RouteMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +279,7 @@ func (client *RouteMapsClient) getHandleResponse(resp *http.Response) (RouteMaps // NewListPager - Retrieves the details of all RouteMaps. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RouteMap's resource group'. // - virtualHubName - The name of the VirtualHub containing the RouteMap. // - options - RouteMapsClientListOptions contains the optional parameters for the RouteMapsClient.NewListPager method. @@ -310,7 +307,7 @@ func (client *RouteMapsClient) NewListPager(resourceGroupName string, virtualHub } // listCreateRequest creates the List request. -func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *RouteMapsClientListOptions) (*policy.Request, error) { +func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *RouteMapsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -329,7 +326,7 @@ func (client *RouteMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index eb8a9ba6cd1b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routemaps_client_example_test.go +++ /dev/null @@ -1,265 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - AssociatedOutboundConnections: []*string{}, - 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), - }}, - }, - }, nil) - if 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.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")}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteMapsClient().BeginDelete(ctx, "rg1", "virtualHub1", "routeMap1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteMapsClient().NewListPager("rg1", "virtualHub1", 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.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")}, - // 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), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routes_client.go b/sdk/resourcemanager/network/armnetwork/routes_client.go index c36ccd11d94c..14314fa30f4f 100644 --- a/sdk/resourcemanager/network/armnetwork/routes_client.go +++ b/sdk/resourcemanager/network/armnetwork/routes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *RoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *RoutesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeParameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -182,7 +179,7 @@ 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, options *RoutesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -205,7 +202,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the specified route from a route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - routeName - The name of the route. @@ -242,7 +239,7 @@ 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, options *RoutesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -265,7 +262,7 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +279,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient // NewListPager - Gets all routes in a route table. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RoutesClientListOptions contains the optional parameters for the RoutesClient.NewListPager method. @@ -310,7 +307,7 @@ func (client *RoutesClient) NewListPager(resourceGroupName string, routeTableNam } // listCreateRequest creates the List request. -func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RoutesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +326,7 @@ func (client *RoutesClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index cfbf687e3813..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routes_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginDelete(ctx, "rg1", "testrt", "route1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/RouteTableRouteCreate.json -func ExampleRoutesClient_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.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) - } - 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutesClient().NewListPager("rg1", "testrt", 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.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), - // }, - // }, - // { - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routetable_live_test.go b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go index a5b3c3051ddb..1f73aef33d6d 100644 --- a/sdk/resourcemanager/network/armnetwork/routetable_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/routetable_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client.go b/sdk/resourcemanager/network/armnetwork/routetables_client.go index c1f4a9cbf4b7..58ebf231d753 100644 --- a/sdk/resourcemanager/network/armnetwork/routetables_client.go +++ b/sdk/resourcemanager/network/armnetwork/routetables_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to the create or update route table operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *RouteTablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *RouteTablesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RouteTablesClientBeginDeleteOptions contains the optional parameters for the RouteTablesClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RouteTablesClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *RouteTablesClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, routeTableName string, options *RouteTablesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -195,7 +192,7 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *RouteTablesClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specified route table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - options - RouteTablesClientGetOptions contains the optional parameters for the RouteTablesClient.Get method. @@ -253,7 +250,7 @@ func (client *RouteTablesClient) getCreateRequest(ctx context.Context, resourceG if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *RouteTablesClient) getHandleResponse(resp *http.Response) (RouteTa // NewListPager - Gets all route tables in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - RouteTablesClientListOptions contains the optional parameters for the RouteTablesClient.NewListPager method. func (client *RouteTablesClient) NewListPager(resourceGroupName string, options *RouteTablesClientListOptions) *runtime.Pager[RouteTablesClientListResponse] { @@ -297,7 +294,7 @@ func (client *RouteTablesClient) NewListPager(resourceGroupName string, options } // listCreateRequest creates the List request. -func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RouteTablesClientListOptions) (*policy.Request, error) { +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") @@ -312,7 +309,7 @@ func (client *RouteTablesClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +326,7 @@ func (client *RouteTablesClient) listHandleResponse(resp *http.Response) (RouteT // NewListAllPager - Gets all route tables in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -355,7 +352,7 @@ func (client *RouteTablesClient) NewListAllPager(options *RouteTablesClientListA } // listAllCreateRequest creates the ListAll request. -func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, options *RouteTablesClientListAllOptions) (*policy.Request, error) { +func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, _ *RouteTablesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -366,7 +363,7 @@ func (client *RouteTablesClient) listAllCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +381,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - routeTableName - The name of the route table. // - parameters - Parameters supplied to update route table tags. @@ -412,7 +409,7 @@ 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, options *RouteTablesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -431,7 +428,7 @@ func (client *RouteTablesClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go b/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go deleted file mode 100644 index e1fe9a8dfac5..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routetables_client_example_test.go +++ /dev/null @@ -1,333 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteTablesClient().BeginDelete(ctx, "rg1", "testrt", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRouteTablesClient().BeginCreateOrUpdate(ctx, "rg1", "testrt", armnetwork.RouteTable{ - Location: to.Ptr("westus"), - Properties: &armnetwork.RouteTablePropertiesFormat{ - DisableBgpRoutePropagation: to.Ptr(true), - Routes: []*armnetwork.Route{ - { - Name: to.Ptr("route1"), - 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) - } - 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.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), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteTablesClient().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.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), - // }, - // }}, - // }, - // }, - // { - // 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{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRouteTablesClient().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.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), - // }, - // }}, - // }, - // }, - // { - // 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{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routingintent_client.go b/sdk/resourcemanager/network/armnetwork/routingintent_client.go index 7b91c238441c..5d4c14e34575 100644 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingintent_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the per VirtualHub singleton Routing Intent resource. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *RoutingIntentClient) createOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, options *RoutingIntentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent, _ *RoutingIntentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *RoutingIntentClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingIntentParameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *RoutingIntentClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientBeginDeleteOptions) (*policy.Request, error) { +func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, _ *RoutingIntentClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *RoutingIntentClient) deleteCreateRequest(ctx context.Context, reso // Get - Retrieves the details of a RoutingIntent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the RoutingIntent. // - virtualHubName - The name of the VirtualHub. // - routingIntentName - The name of the RoutingIntent. @@ -243,7 +240,7 @@ func (client *RoutingIntentClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, options *RoutingIntentClientGetOptions) (*policy.Request, error) { +func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, _ *RoutingIntentClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -266,7 +263,7 @@ func (client *RoutingIntentClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - RoutingIntentClientListOptions contains the optional parameters for the RoutingIntentClient.NewListPager method. @@ -311,7 +308,7 @@ func (client *RoutingIntentClient) NewListPager(resourceGroupName string, virtua } // listCreateRequest creates the List request. -func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *RoutingIntentClientListOptions) (*policy.Request, error) { +func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *RoutingIntentClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -330,7 +327,7 @@ func (client *RoutingIntentClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a4c6bc5d9911..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingintent_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutingIntentClient().BeginCreateOrUpdate(ctx, "rg1", "virtualHub1", "Intent1", armnetwork.RoutingIntent{ - Properties: &armnetwork.RoutingIntentProperties{ - 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"), - }}, - }, - }, nil) - if 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.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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutingIntentClient().Get(ctx, "rg1", "virtualHub1", "Intent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutingIntentClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutingIntentClient().NewListPager("rg1", "virtualHub1", 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.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"), - // }, - // { - // Name: to.Ptr("PrivateTrafficPolicy"), - // Destinations: []*string{ - // to.Ptr("PrivateTraffic")}, - // NextHop: to.Ptr("/subscriptions/subid/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 ec5827697e6c..840c2bb405a5 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrulecollections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -79,7 +76,7 @@ func (client *RoutingRuleCollectionsClient) CreateOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoutingRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection RoutingRuleCollection, options *RoutingRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RoutingRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleCollection RoutingRuleCollection, _ *RoutingRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *RoutingRuleCollectionsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleCollection); err != nil { @@ -127,7 +124,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +202,7 @@ func (client *RoutingRuleCollectionsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +214,7 @@ func (client *RoutingRuleCollectionsClient) deleteCreateRequest(ctx context.Cont // Get - Gets a network manager routing configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -247,7 +244,7 @@ func (client *RoutingRuleCollectionsClient) Get(ctx context.Context, resourceGro } // getCreateRequest creates the Get request. -func (client *RoutingRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *RoutingRuleCollectionsClientGetOptions) (*policy.Request, error) { +func (client *RoutingRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, _ *RoutingRuleCollectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -274,7 +271,7 @@ func (client *RoutingRuleCollectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +288,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -350,7 +347,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 647fde7511f0..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingrulecollections_client_example_test.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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("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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/routingrules_client.go b/sdk/resourcemanager/network/armnetwork/routingrules_client.go index 5db1470aa41c..9fea640fd26b 100644 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/routingrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -80,7 +77,7 @@ func (client *RoutingRulesClient) CreateOrUpdate(ctx context.Context, resourceGr } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoutingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, routingRule RoutingRule, options *RoutingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RoutingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, routingRule RoutingRule, _ *RoutingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -111,7 +108,7 @@ func (client *RoutingRulesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routingRule); err != nil { @@ -132,7 +129,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -161,7 +158,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -215,7 +212,7 @@ func (client *RoutingRulesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -227,7 +224,7 @@ func (client *RoutingRulesClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets a network manager routing configuration routing rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -257,7 +254,7 @@ func (client *RoutingRulesClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *RoutingRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *RoutingRulesClientGetOptions) (*policy.Request, error) { +func (client *RoutingRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, _ *RoutingRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -288,7 +285,7 @@ func (client *RoutingRulesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +302,7 @@ func (client *RoutingRulesClient) getHandleResponse(resp *http.Response) (Routin // NewListPager - List all network manager routing configuration routing rules. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -368,7 +365,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 71a055e6756d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/routingrules_client_example_test.go +++ /dev/null @@ -1,199 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutingRulesClient().Get(ctx, "rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleRoutingRule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkManagerRoutingRulePut.json -func ExampleRoutingRulesClient_CreateOrUpdate_createADefaultRoutingRule() { - cred, err := 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.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/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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - 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/scopeconnections_client.go b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go index 95db6b1bfa84..5cf214b097e9 100644 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/scopeconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -78,7 +75,7 @@ func (client *ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, options *ScopeConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, parameters ScopeConnection, _ *ScopeConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,7 +98,7 @@ func (client *ScopeConnectionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -122,7 +119,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -149,7 +146,7 @@ func (client *ScopeConnectionsClient) Delete(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, _ *ScopeConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +169,7 @@ func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,7 @@ func (client *ScopeConnectionsClient) deleteCreateRequest(ctx context.Context, r // Get - Get specified scope connection created by this Network Manager. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - scopeConnectionName - Name for the cross-tenant connection. @@ -209,7 +206,7 @@ func (client *ScopeConnectionsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, options *ScopeConnectionsClientGetOptions) (*policy.Request, error) { +func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string, _ *ScopeConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -232,7 +229,7 @@ func (client *ScopeConnectionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +246,7 @@ func (client *ScopeConnectionsClient) getHandleResponse(resp *http.Response) (Sc // NewListPager - List all scope connections created by this network manager. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - ScopeConnectionsClientListOptions contains the optional parameters for the ScopeConnectionsClient.NewListPager @@ -303,7 +300,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 633d5d04fd96..000000000000 --- a/sdk/resourcemanager/network/armnetwork/scopeconnections_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopeConnectionsClient().CreateOrUpdate(ctx, "rg1", "testNetworkManager", "TestScopeConnection", armnetwork.ScopeConnection{ - Properties: &armnetwork.ScopeConnectionProperties{ - Description: to.Ptr("This is a scope connection to a cross tenant subscription."), - ResourceID: to.Ptr("subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b"), - TenantID: to.Ptr("6babcaad-604b-40ac-a9d7-9fd97c0b779f"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScopeConnectionsClient().Delete(ctx, "rg1", "testNetworkManager", "TestScopeConnection", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScopeConnectionsClient().NewListPager("rg1", "testNetworkManager", &armnetwork.ScopeConnectionsClientListOptions{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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go index 68e69278ece4..704e216c9fb0 100644 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -78,7 +75,7 @@ func (client *SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, options *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityAdminConfiguration SecurityAdminConfiguration, _ *SecurityAdminConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,7 +98,7 @@ func (client *SecurityAdminConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityAdminConfiguration); err != nil { @@ -122,7 +119,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -149,7 +146,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -195,7 +192,7 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +204,7 @@ func (client *SecurityAdminConfigurationsClient) deleteCreateRequest(ctx context // Get - Retrieves a network manager security admin configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - configurationName - The name of the network manager Security Configuration. @@ -236,7 +233,7 @@ func (client *SecurityAdminConfigurationsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityAdminConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, _ *SecurityAdminConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -259,7 +256,7 @@ func (client *SecurityAdminConfigurationsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +273,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - SecurityAdminConfigurationsClientListOptions contains the optional parameters for the SecurityAdminConfigurationsClient.NewListPager @@ -330,7 +327,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index ecbec6811c72..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityadminconfigurations_client_example_test.go +++ /dev/null @@ -1,219 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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/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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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)}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go index e231d3ab367d..8250307195a2 100644 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitygroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to the create or update network security group operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *SecurityGroupsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *SecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientBeginDeleteOptions contains the optional parameters for the SecurityGroupsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityGroupsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *SecurityGroupsClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityGroupsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *SecurityGroupsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified network security group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityGroupsClientGetOptions contains the optional parameters for the SecurityGroupsClient.Get method. @@ -254,7 +251,7 @@ func (client *SecurityGroupsClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *SecurityGroupsClient) getHandleResponse(resp *http.Response) (Secu // NewListPager - Gets all network security groups in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - SecurityGroupsClientListOptions contains the optional parameters for the SecurityGroupsClient.NewListPager method. func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, options *SecurityGroupsClientListOptions) *runtime.Pager[SecurityGroupsClientListResponse] { @@ -298,7 +295,7 @@ func (client *SecurityGroupsClient) NewListPager(resourceGroupName string, optio } // listCreateRequest creates the List request. -func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityGroupsClientListOptions) (*policy.Request, error) { +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") @@ -313,7 +310,7 @@ func (client *SecurityGroupsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +327,7 @@ func (client *SecurityGroupsClient) listHandleResponse(resp *http.Response) (Sec // NewListAllPager - Gets all network security groups in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - SecurityGroupsClientListAllOptions contains the optional parameters for the SecurityGroupsClient.NewListAllPager // method. func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClientListAllOptions) *runtime.Pager[SecurityGroupsClientListAllResponse] { @@ -357,7 +354,7 @@ func (client *SecurityGroupsClient) NewListAllPager(options *SecurityGroupsClien } // listAllCreateRequest creates the ListAll request. -func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, options *SecurityGroupsClientListAllOptions) (*policy.Request, error) { +func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, _ *SecurityGroupsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +365,7 @@ func (client *SecurityGroupsClient) listAllCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - parameters - Parameters supplied to update network security group tags. @@ -415,7 +412,7 @@ 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, options *SecurityGroupsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -434,7 +431,7 @@ func (client *SecurityGroupsClient) updateTagsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go deleted file mode 100644 index 2ce27637920e..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securitygroups_client_example_test.go +++ /dev/null @@ -1,1106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", armnetwork.SecurityGroup{ - 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 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.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), - // }, - // }, - // { - // 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), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityGroupsClient().BeginCreateOrUpdate(ctx, "rg1", "testnsg", armnetwork.SecurityGroup{ - Location: to.Ptr("eastus"), - Properties: &armnetwork.SecurityGroupPropertiesFormat{ - SecurityRules: []*armnetwork.SecurityRule{ - { - 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), - SourceAddressPrefix: to.Ptr("*"), - SourcePortRange: to.Ptr("*"), - Protocol: to.Ptr(armnetwork.SecurityRuleProtocolAsterisk), - }, - }}, - }, - }, nil) - if 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.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), - // }, - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // }, - // { - // 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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityGroupsClient().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.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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityGroupsClient().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.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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // }}, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // SecurityRules: []*armnetwork.SecurityRule{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go index ce86951714c9..10218d15c7fe 100644 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go +++ b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to the create or update Security Partner Provider operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *SecurityPartnerProvidersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *SecurityPartnerProvidersClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientBeginDeleteOptions contains the optional parameters for the SecurityPartnerProvidersClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPartnerProvidersClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *SecurityPartnerProvidersClient) deleteOperation(ctx context.Contex } // deleteCreateRequest creates the Delete request. -func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *SecurityPartnerProvidersClient) deleteCreateRequest(ctx context.Co // Get - Gets the specified Security Partner Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - options - SecurityPartnerProvidersClientGetOptions contains the optional parameters for the SecurityPartnerProvidersClient.Get @@ -233,7 +230,7 @@ func (client *SecurityPartnerProvidersClient) Get(ctx context.Context, resourceG } // getCreateRequest creates the Get request. -func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, options *SecurityPartnerProvidersClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *SecurityPartnerProvidersClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *SecurityPartnerProvidersClient) getHandleResponse(resp *http.Respo // NewListPager - Gets all the Security Partner Providers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - SecurityPartnerProvidersClientListOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListPager // method. func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPartnerProvidersClientListOptions) *runtime.Pager[SecurityPartnerProvidersClientListResponse] { @@ -296,7 +293,7 @@ func (client *SecurityPartnerProvidersClient) NewListPager(options *SecurityPart } // listCreateRequest creates the List request. -func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Context, options *SecurityPartnerProvidersClientListOptions) (*policy.Request, error) { +func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Context, _ *SecurityPartnerProvidersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -307,7 +304,7 @@ func (client *SecurityPartnerProvidersClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +321,7 @@ func (client *SecurityPartnerProvidersClient) listHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Lists all Security Partner Providers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - SecurityPartnerProvidersClientListByResourceGroupOptions contains the optional parameters for the SecurityPartnerProvidersClient.NewListByResourceGroupPager // method. @@ -352,7 +349,7 @@ func (client *SecurityPartnerProvidersClient) NewListByResourceGroupPager(resour } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityPartnerProvidersClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -367,7 +364,7 @@ func (client *SecurityPartnerProvidersClient) listByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - securityPartnerProviderName - The name of the Security Partner Provider. // - parameters - Parameters supplied to update Security Partner Provider tags. @@ -414,7 +411,7 @@ 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, options *SecurityPartnerProvidersClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -433,7 +430,7 @@ func (client *SecurityPartnerProvidersClient) updateTagsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go b/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go deleted file mode 100644 index 228f523da716..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securitypartnerproviders_client_example_test.go +++ /dev/null @@ -1,261 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPartnerProvidersClient().BeginDelete(ctx, "rg1", "securityPartnerProvider", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityPartnerProvidersClient().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.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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityPartnerProvidersClient().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.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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go new file mode 100644 index 000000000000..4c2d4a3b6290 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteraccessrules_client.go @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterAccessRulesClient contains the methods for the NetworkSecurityPerimeterAccessRules group. +// Don't use this type directly, use NewSecurityPerimeterAccessRulesClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterAccessRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAccessRulesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterAccessRulesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a network access rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - profileName - The name of the NSP profile. +// - accessRuleName - The name of the NSP access rule. +// - parameters - Parameters that hold the NspAccessRule resource to be created/updated. +// - options - SecurityPerimeterAccessRulesClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.CreateOrUpdate +// method. +func (client *SecurityPerimeterAccessRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters NspAccessRule, options *SecurityPerimeterAccessRulesClientCreateOrUpdateOptions) (SecurityPerimeterAccessRulesClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SecurityPerimeterAccessRulesClient.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, networkSecurityPerimeterName, profileName, accessRuleName, parameters, options) + if err != nil { + return SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimeterAccessRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters NspAccessRule, _ *SecurityPerimeterAccessRulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if accessRuleName == "" { + return nil, errors.New("parameter accessRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessRuleName}", url.PathEscape(accessRuleName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityPerimeterAccessRulesClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityPerimeterAccessRulesClientCreateOrUpdateResponse, error) { + result := SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspAccessRule); err != nil { + return SecurityPerimeterAccessRulesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes an NSP access rule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - profileName - The name of the NSP profile. +// - accessRuleName - The name of the NSP access rule. +// - options - SecurityPerimeterAccessRulesClientDeleteOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Delete +// method. +func (client *SecurityPerimeterAccessRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, options *SecurityPerimeterAccessRulesClientDeleteOptions) (SecurityPerimeterAccessRulesClientDeleteResponse, error) { + var err error + const operationName = "SecurityPerimeterAccessRulesClient.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, networkSecurityPerimeterName, profileName, accessRuleName, options) + if err != nil { + return SecurityPerimeterAccessRulesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterAccessRulesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterAccessRulesClientDeleteResponse{}, err + } + return SecurityPerimeterAccessRulesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterAccessRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, _ *SecurityPerimeterAccessRulesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if accessRuleName == "" { + return nil, errors.New("parameter accessRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessRuleName}", url.PathEscape(accessRuleName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - profileName - The name of the NSP profile. +// - accessRuleName - The name of the NSP access rule. +// - options - SecurityPerimeterAccessRulesClientGetOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Get +// method. +func (client *SecurityPerimeterAccessRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, options *SecurityPerimeterAccessRulesClientGetOptions) (SecurityPerimeterAccessRulesClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterAccessRulesClient.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, networkSecurityPerimeterName, profileName, accessRuleName, options) + if err != nil { + return SecurityPerimeterAccessRulesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterAccessRulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterAccessRulesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterAccessRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, _ *SecurityPerimeterAccessRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if accessRuleName == "" { + return nil, errors.New("parameter accessRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessRuleName}", url.PathEscape(accessRuleName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterAccessRulesClient) getHandleResponse(resp *http.Response) (SecurityPerimeterAccessRulesClientGetResponse, error) { + result := SecurityPerimeterAccessRulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspAccessRule); err != nil { + return SecurityPerimeterAccessRulesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP access rules in the specified NSP profile. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterAccessRulesClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *SecurityPerimeterAccessRulesClientListOptions) *runtime.Pager[SecurityPerimeterAccessRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterAccessRulesClientListResponse]{ + More: func(page SecurityPerimeterAccessRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterAccessRulesClientListResponse) (SecurityPerimeterAccessRulesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterAccessRulesClient.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, networkSecurityPerimeterName, profileName, options) + }, nil) + if err != nil { + return SecurityPerimeterAccessRulesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterAccessRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *SecurityPerimeterAccessRulesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterAccessRulesClient) listHandleResponse(resp *http.Response) (SecurityPerimeterAccessRulesClientListResponse, error) { + result := SecurityPerimeterAccessRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspAccessRuleListResult); err != nil { + return SecurityPerimeterAccessRulesClientListResponse{}, err + } + return result, nil +} + +// Reconcile - Reconcile NSP access rules +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - profileName - The name of the NSP profile. +// - accessRuleName - The name of the NSP access rule. +// - parameters - Parameters for NSP access rule reconcile +// - options - SecurityPerimeterAccessRulesClientReconcileOptions contains the optional parameters for the SecurityPerimeterAccessRulesClient.Reconcile +// method. +func (client *SecurityPerimeterAccessRulesClient) Reconcile(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters any, options *SecurityPerimeterAccessRulesClientReconcileOptions) (SecurityPerimeterAccessRulesClientReconcileResponse, error) { + var err error + const operationName = "SecurityPerimeterAccessRulesClient.Reconcile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, networkSecurityPerimeterName, profileName, accessRuleName, parameters, options) + if err != nil { + return SecurityPerimeterAccessRulesClientReconcileResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterAccessRulesClientReconcileResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterAccessRulesClientReconcileResponse{}, err + } + resp, err := client.reconcileHandleResponse(httpResp) + return resp, err +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *SecurityPerimeterAccessRulesClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, accessRuleName string, parameters any, _ *SecurityPerimeterAccessRulesClientReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}/reconcile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if accessRuleName == "" { + return nil, errors.New("parameter accessRuleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accessRuleName}", url.PathEscape(accessRuleName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// reconcileHandleResponse handles the Reconcile response. +func (client *SecurityPerimeterAccessRulesClient) reconcileHandleResponse(resp *http.Response) (SecurityPerimeterAccessRulesClientReconcileResponse, error) { + result := SecurityPerimeterAccessRulesClientReconcileResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return SecurityPerimeterAccessRulesClientReconcileResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go new file mode 100644 index 000000000000..0140a6dfb929 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociableresourcetypes_client.go @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterAssociableResourceTypesClient contains the methods for the NetworkSecurityPerimeterAssociableResourceTypes +// group. +// Don't use this type directly, use NewSecurityPerimeterAssociableResourceTypesClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterAssociableResourceTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAssociableResourceTypesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterAssociableResourceTypesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 2024-07-01 +// - location - The location of network security perimeter. +// - options - SecurityPerimeterAssociableResourceTypesClientListOptions contains the optional parameters for the SecurityPerimeterAssociableResourceTypesClient.NewListPager +// method. +func (client *SecurityPerimeterAssociableResourceTypesClient) NewListPager(location string, options *SecurityPerimeterAssociableResourceTypesClientListOptions) *runtime.Pager[SecurityPerimeterAssociableResourceTypesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterAssociableResourceTypesClientListResponse]{ + More: func(page SecurityPerimeterAssociableResourceTypesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterAssociableResourceTypesClientListResponse) (SecurityPerimeterAssociableResourceTypesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterAssociableResourceTypesClient.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, location, options) + }, nil) + if err != nil { + return SecurityPerimeterAssociableResourceTypesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterAssociableResourceTypesClient) listCreateRequest(ctx context.Context, location string, _ *SecurityPerimeterAssociableResourceTypesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/perimeterAssociableResourceTypes" + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterAssociableResourceTypesClient) listHandleResponse(resp *http.Response) (SecurityPerimeterAssociableResourceTypesClientListResponse, error) { + result := SecurityPerimeterAssociableResourceTypesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PerimeterAssociableResourcesListResult); err != nil { + return SecurityPerimeterAssociableResourceTypesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go new file mode 100644 index 000000000000..5ae66ce2f5cf --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterassociations_client.go @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterAssociationsClient contains the methods for the NetworkSecurityPerimeterAssociations group. +// Don't use this type directly, use NewSecurityPerimeterAssociationsClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterAssociationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterAssociationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterAssociationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a NSP resource association. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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. +// - options - SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.BeginCreateOrUpdate +// method. +func (client *SecurityPerimeterAssociationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters NspAssociation, options *SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecurityPerimeterAssociationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, networkSecurityPerimeterName, associationName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterAssociationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPerimeterAssociationsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Creates or updates a NSP resource association. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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" + 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, networkSecurityPerimeterName, associationName, parameters, 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, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimeterAssociationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, parameters NspAssociation, _ *SecurityPerimeterAssociationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes an NSP association resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterAssociationsClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, options *SecurityPerimeterAssociationsClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterAssociationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityPerimeterName, associationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterAssociationsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPerimeterAssociationsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an NSP association resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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" + 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, networkSecurityPerimeterName, associationName, 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, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterAssociationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, _ *SecurityPerimeterAssociationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterAssociationsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, options *SecurityPerimeterAssociationsClientGetOptions) (SecurityPerimeterAssociationsClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterAssociationsClient.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, networkSecurityPerimeterName, associationName, options) + if err != nil { + return SecurityPerimeterAssociationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterAssociationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterAssociationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterAssociationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, associationName string, _ *SecurityPerimeterAssociationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if associationName == "" { + return nil, errors.New("parameter associationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{associationName}", url.PathEscape(associationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterAssociationsClient) getHandleResponse(resp *http.Response) (SecurityPerimeterAssociationsClientGetResponse, error) { + result := SecurityPerimeterAssociationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspAssociation); err != nil { + return SecurityPerimeterAssociationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP resource associations. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimeterAssociationsClientListOptions contains the optional parameters for the SecurityPerimeterAssociationsClient.NewListPager +// method. +func (client *SecurityPerimeterAssociationsClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterAssociationsClientListOptions) *runtime.Pager[SecurityPerimeterAssociationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterAssociationsClientListResponse]{ + More: func(page SecurityPerimeterAssociationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterAssociationsClientListResponse) (SecurityPerimeterAssociationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterAssociationsClient.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, networkSecurityPerimeterName, options) + }, nil) + if err != nil { + return SecurityPerimeterAssociationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterAssociationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterAssociationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterAssociationsClient) listHandleResponse(resp *http.Response) (SecurityPerimeterAssociationsClientListResponse, error) { + result := SecurityPerimeterAssociationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspAssociationsListResult); err != nil { + return SecurityPerimeterAssociationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go new file mode 100644 index 000000000000..1e882063f281 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinkreferences_client.go @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterLinkReferencesClient contains the methods for the NetworkSecurityPerimeterLinkReferences group. +// Don't use this type directly, use NewSecurityPerimeterLinkReferencesClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterLinkReferencesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLinkReferencesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterLinkReferencesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDelete - Deletes an NSP LinkReference resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLinkReferencesClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, options *SecurityPerimeterLinkReferencesClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterLinkReferencesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityPerimeterName, linkReferenceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterLinkReferencesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPerimeterLinkReferencesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an NSP LinkReference resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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" + 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, networkSecurityPerimeterName, linkReferenceName, 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, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterLinkReferencesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, _ *SecurityPerimeterLinkReferencesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/linkReferences/{linkReferenceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if linkReferenceName == "" { + return nil, errors.New("parameter linkReferenceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkReferenceName}", url.PathEscape(linkReferenceName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified NSP linkReference resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLinkReferencesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, options *SecurityPerimeterLinkReferencesClientGetOptions) (SecurityPerimeterLinkReferencesClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterLinkReferencesClient.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, networkSecurityPerimeterName, linkReferenceName, options) + if err != nil { + return SecurityPerimeterLinkReferencesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLinkReferencesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLinkReferencesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterLinkReferencesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkReferenceName string, _ *SecurityPerimeterLinkReferencesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/linkReferences/{linkReferenceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if linkReferenceName == "" { + return nil, errors.New("parameter linkReferenceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkReferenceName}", url.PathEscape(linkReferenceName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterLinkReferencesClient) getHandleResponse(resp *http.Response) (SecurityPerimeterLinkReferencesClientGetResponse, error) { + result := SecurityPerimeterLinkReferencesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLinkReference); err != nil { + return SecurityPerimeterLinkReferencesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP LinkReference resources in the specified network security perimeter. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimeterLinkReferencesClientListOptions contains the optional parameters for the SecurityPerimeterLinkReferencesClient.NewListPager +// method. +func (client *SecurityPerimeterLinkReferencesClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterLinkReferencesClientListOptions) *runtime.Pager[SecurityPerimeterLinkReferencesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterLinkReferencesClientListResponse]{ + More: func(page SecurityPerimeterLinkReferencesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterLinkReferencesClientListResponse) (SecurityPerimeterLinkReferencesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterLinkReferencesClient.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, networkSecurityPerimeterName, options) + }, nil) + if err != nil { + return SecurityPerimeterLinkReferencesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterLinkReferencesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterLinkReferencesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/linkReferences" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterLinkReferencesClient) listHandleResponse(resp *http.Response) (SecurityPerimeterLinkReferencesClientListResponse, error) { + result := SecurityPerimeterLinkReferencesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLinkReferenceListResult); err != nil { + return SecurityPerimeterLinkReferencesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go new file mode 100644 index 000000000000..a0eae63cf119 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterlinks_client.go @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterLinksClient contains the methods for the NetworkSecurityPerimeterLinks group. +// Don't use this type directly, use NewSecurityPerimeterLinksClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLinksClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates NSP link resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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. +// - options - SecurityPerimeterLinksClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterLinksClient.CreateOrUpdate +// method. +func (client *SecurityPerimeterLinksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, parameters NspLink, options *SecurityPerimeterLinksClientCreateOrUpdateOptions) (SecurityPerimeterLinksClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SecurityPerimeterLinksClient.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, networkSecurityPerimeterName, linkName, parameters, options) + if err != nil { + return SecurityPerimeterLinksClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLinksClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLinksClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimeterLinksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, parameters NspLink, _ *SecurityPerimeterLinksClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/links/{linkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if linkName == "" { + return nil, errors.New("parameter linkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkName}", url.PathEscape(linkName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityPerimeterLinksClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityPerimeterLinksClientCreateOrUpdateResponse, error) { + result := SecurityPerimeterLinksClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLink); err != nil { + return SecurityPerimeterLinksClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes an NSP Link resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLinksClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, options *SecurityPerimeterLinksClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimeterLinksClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityPerimeterName, linkName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimeterLinksClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPerimeterLinksClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an NSP Link resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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" + 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, networkSecurityPerimeterName, linkName, 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, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, _ *SecurityPerimeterLinksClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/links/{linkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if linkName == "" { + return nil, errors.New("parameter linkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkName}", url.PathEscape(linkName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified NSP link resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLinksClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, options *SecurityPerimeterLinksClientGetOptions) (SecurityPerimeterLinksClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterLinksClient.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, networkSecurityPerimeterName, linkName, options) + if err != nil { + return SecurityPerimeterLinksClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLinksClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLinksClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, linkName string, _ *SecurityPerimeterLinksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/links/{linkName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if linkName == "" { + return nil, errors.New("parameter linkName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{linkName}", url.PathEscape(linkName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterLinksClient) getHandleResponse(resp *http.Response) (SecurityPerimeterLinksClientGetResponse, error) { + result := SecurityPerimeterLinksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLink); err != nil { + return SecurityPerimeterLinksClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP Link resources in the specified network security perimeter. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimeterLinksClientListOptions contains the optional parameters for the SecurityPerimeterLinksClient.NewListPager +// method. +func (client *SecurityPerimeterLinksClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterLinksClientListOptions) *runtime.Pager[SecurityPerimeterLinksClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterLinksClientListResponse]{ + More: func(page SecurityPerimeterLinksClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterLinksClientListResponse) (SecurityPerimeterLinksClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterLinksClient.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, networkSecurityPerimeterName, options) + }, nil) + if err != nil { + return SecurityPerimeterLinksClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterLinksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/links" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterLinksClient) listHandleResponse(resp *http.Response) (SecurityPerimeterLinksClientListResponse, error) { + result := SecurityPerimeterLinksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLinkListResult); err != nil { + return SecurityPerimeterLinksClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go new file mode 100644 index 000000000000..7022f72915ad --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterloggingconfigurations_client.go @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterLoggingConfigurationsClient contains the methods for the NetworkSecurityPerimeterLoggingConfigurations +// group. +// Don't use this type directly, use NewSecurityPerimeterLoggingConfigurationsClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterLoggingConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterLoggingConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterLoggingConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates NSP logging configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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. +// - options - SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.CreateOrUpdate +// method. +func (client *SecurityPerimeterLoggingConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, parameters NspLoggingConfiguration, options *SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions) (SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SecurityPerimeterLoggingConfigurationsClient.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, networkSecurityPerimeterName, loggingConfigurationName, parameters, options) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimeterLoggingConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, parameters NspLoggingConfiguration, _ *SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/loggingConfigurations/{loggingConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if loggingConfigurationName == "" { + return nil, errors.New("parameter loggingConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loggingConfigurationName}", url.PathEscape(loggingConfigurationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityPerimeterLoggingConfigurationsClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse, error) { + result := SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLoggingConfiguration); err != nil { + return SecurityPerimeterLoggingConfigurationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes an NSP Logging configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLoggingConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, options *SecurityPerimeterLoggingConfigurationsClientDeleteOptions) (SecurityPerimeterLoggingConfigurationsClientDeleteResponse, error) { + var err error + const operationName = "SecurityPerimeterLoggingConfigurationsClient.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, networkSecurityPerimeterName, loggingConfigurationName, options) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLoggingConfigurationsClientDeleteResponse{}, err + } + return SecurityPerimeterLoggingConfigurationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterLoggingConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, _ *SecurityPerimeterLoggingConfigurationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/loggingConfigurations/{loggingConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if loggingConfigurationName == "" { + return nil, errors.New("parameter loggingConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loggingConfigurationName}", url.PathEscape(loggingConfigurationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the NSP logging configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterLoggingConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, options *SecurityPerimeterLoggingConfigurationsClientGetOptions) (SecurityPerimeterLoggingConfigurationsClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterLoggingConfigurationsClient.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, networkSecurityPerimeterName, loggingConfigurationName, options) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterLoggingConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterLoggingConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, loggingConfigurationName string, _ *SecurityPerimeterLoggingConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/loggingConfigurations/{loggingConfigurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if loggingConfigurationName == "" { + return nil, errors.New("parameter loggingConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loggingConfigurationName}", url.PathEscape(loggingConfigurationName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterLoggingConfigurationsClient) getHandleResponse(resp *http.Response) (SecurityPerimeterLoggingConfigurationsClientGetResponse, error) { + result := SecurityPerimeterLoggingConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLoggingConfiguration); err != nil { + return SecurityPerimeterLoggingConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP logging configuration. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimeterLoggingConfigurationsClientListOptions contains the optional parameters for the SecurityPerimeterLoggingConfigurationsClient.NewListPager +// method. +func (client *SecurityPerimeterLoggingConfigurationsClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterLoggingConfigurationsClientListOptions) *runtime.Pager[SecurityPerimeterLoggingConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterLoggingConfigurationsClientListResponse]{ + More: func(page SecurityPerimeterLoggingConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterLoggingConfigurationsClientListResponse) (SecurityPerimeterLoggingConfigurationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterLoggingConfigurationsClient.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, networkSecurityPerimeterName, options) + }, nil) + if err != nil { + return SecurityPerimeterLoggingConfigurationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterLoggingConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, _ *SecurityPerimeterLoggingConfigurationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/loggingConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterLoggingConfigurationsClient) listHandleResponse(resp *http.Response) (SecurityPerimeterLoggingConfigurationsClientListResponse, error) { + result := SecurityPerimeterLoggingConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspLoggingConfigurationListResult); err != nil { + return SecurityPerimeterLoggingConfigurationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go new file mode 100644 index 000000000000..e05c63762266 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeteroperationstatuses_client.go @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterOperationStatusesClient contains the methods for the NetworkSecurityPerimeterOperationStatuses group. +// Don't use this type directly, use NewSecurityPerimeterOperationStatusesClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterOperationStatusesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterOperationStatusesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets the operation status for the given operation id. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - location - The location of network security perimeter. +// - operationID - The operation id of the async operation. +// - options - SecurityPerimeterOperationStatusesClientGetOptions contains the optional parameters for the SecurityPerimeterOperationStatusesClient.Get +// method. +func (client *SecurityPerimeterOperationStatusesClient) Get(ctx context.Context, location string, operationID string, options *SecurityPerimeterOperationStatusesClientGetOptions) (SecurityPerimeterOperationStatusesClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterOperationStatusesClient.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, location, operationID, options) + if err != nil { + return SecurityPerimeterOperationStatusesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterOperationStatusesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterOperationStatusesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterOperationStatusesClient) getCreateRequest(ctx context.Context, location string, operationID string, _ *SecurityPerimeterOperationStatusesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/networkSecurityPerimeterOperationStatuses/{operationId}" + 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)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterOperationStatusesClient) getHandleResponse(resp *http.Response) (SecurityPerimeterOperationStatusesClientGetResponse, error) { + result := SecurityPerimeterOperationStatusesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatusResult); err != nil { + return SecurityPerimeterOperationStatusesClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go new file mode 100644 index 000000000000..e82f7dc6d1e4 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeterprofiles_client.go @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimeterProfilesClient contains the methods for the NetworkSecurityPerimeterProfiles group. +// Don't use this type directly, use NewSecurityPerimeterProfilesClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimeterProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimeterProfilesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimeterProfilesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a network profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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. +// - options - SecurityPerimeterProfilesClientCreateOrUpdateOptions contains the optional parameters for the SecurityPerimeterProfilesClient.CreateOrUpdate +// method. +func (client *SecurityPerimeterProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, parameters NspProfile, options *SecurityPerimeterProfilesClientCreateOrUpdateOptions) (SecurityPerimeterProfilesClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SecurityPerimeterProfilesClient.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, networkSecurityPerimeterName, profileName, parameters, options) + if err != nil { + return SecurityPerimeterProfilesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterProfilesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterProfilesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimeterProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, parameters NspProfile, _ *SecurityPerimeterProfilesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityPerimeterProfilesClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityPerimeterProfilesClientCreateOrUpdateResponse, error) { + result := SecurityPerimeterProfilesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspProfile); err != nil { + return SecurityPerimeterProfilesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes an NSP profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterProfilesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *SecurityPerimeterProfilesClientDeleteOptions) (SecurityPerimeterProfilesClientDeleteResponse, error) { + var err error + const operationName = "SecurityPerimeterProfilesClient.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, networkSecurityPerimeterName, profileName, options) + if err != nil { + return SecurityPerimeterProfilesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterProfilesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterProfilesClientDeleteResponse{}, err + } + return SecurityPerimeterProfilesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimeterProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, _ *SecurityPerimeterProfilesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified NSP profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimeterProfilesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, options *SecurityPerimeterProfilesClientGetOptions) (SecurityPerimeterProfilesClientGetResponse, error) { + var err error + const operationName = "SecurityPerimeterProfilesClient.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, networkSecurityPerimeterName, profileName, options) + if err != nil { + return SecurityPerimeterProfilesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimeterProfilesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimeterProfilesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimeterProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, profileName string, _ *SecurityPerimeterProfilesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimeterProfilesClient) getHandleResponse(resp *http.Response) (SecurityPerimeterProfilesClientGetResponse, error) { + result := SecurityPerimeterProfilesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspProfile); err != nil { + return SecurityPerimeterProfilesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the NSP profiles in the specified network security perimeter. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimeterProfilesClientListOptions contains the optional parameters for the SecurityPerimeterProfilesClient.NewListPager +// method. +func (client *SecurityPerimeterProfilesClient) NewListPager(resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterProfilesClientListOptions) *runtime.Pager[SecurityPerimeterProfilesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimeterProfilesClientListResponse]{ + More: func(page SecurityPerimeterProfilesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimeterProfilesClientListResponse) (SecurityPerimeterProfilesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimeterProfilesClient.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, networkSecurityPerimeterName, options) + }, nil) + if err != nil { + return SecurityPerimeterProfilesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimeterProfilesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimeterProfilesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimeterProfilesClient) listHandleResponse(resp *http.Response) (SecurityPerimeterProfilesClientListResponse, error) { + result := SecurityPerimeterProfilesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NspProfileListResult); err != nil { + return SecurityPerimeterProfilesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go b/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go new file mode 100644 index 000000000000..2e2edbb83aa1 --- /dev/null +++ b/sdk/resourcemanager/network/armnetwork/securityperimeters_client.go @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code 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 ( + "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" +) + +// SecurityPerimetersClient contains the methods for the NetworkSecurityPerimeters group. +// Don't use this type directly, use NewSecurityPerimetersClient() instead. +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. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSecurityPerimetersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPerimetersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &SecurityPerimetersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a Network Security Perimeter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimetersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters SecurityPerimeter, options *SecurityPerimetersClientCreateOrUpdateOptions) (SecurityPerimetersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "SecurityPerimetersClient.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, networkSecurityPerimeterName, parameters, options) + if err != nil { + return SecurityPerimetersClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimetersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimetersClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityPerimetersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters SecurityPerimeter, _ *SecurityPerimetersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityPerimetersClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityPerimetersClientCreateOrUpdateResponse, error) { + result := SecurityPerimetersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPerimeter); err != nil { + return SecurityPerimetersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a network security perimeter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkSecurityPerimeterName - The name of the network security perimeter. +// - options - SecurityPerimetersClientBeginDeleteOptions contains the optional parameters for the SecurityPerimetersClient.BeginDelete +// method. +func (client *SecurityPerimetersClient) BeginDelete(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimetersClientBeginDeleteOptions) (*runtime.Poller[SecurityPerimetersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, networkSecurityPerimeterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPerimetersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SecurityPerimetersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a network security perimeter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *SecurityPerimetersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, options *SecurityPerimetersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "SecurityPerimetersClient.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, networkSecurityPerimeterName, 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, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityPerimetersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, _ *SecurityPerimetersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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) { + var err error + const operationName = "SecurityPerimetersClient.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, networkSecurityPerimeterName, options) + if err != nil { + return SecurityPerimetersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimetersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimetersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *SecurityPerimetersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, _ *SecurityPerimetersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityPerimetersClient) getHandleResponse(resp *http.Response) (SecurityPerimetersClientGetResponse, error) { + result := SecurityPerimetersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPerimeter); err != nil { + return SecurityPerimetersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List network security perimeters in a resource group. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - options - SecurityPerimetersClientListOptions contains the optional parameters for the SecurityPerimetersClient.NewListPager +// method. +func (client *SecurityPerimetersClient) NewListPager(resourceGroupName string, options *SecurityPerimetersClientListOptions) *runtime.Pager[SecurityPerimetersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimetersClientListResponse]{ + More: func(page SecurityPerimetersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimetersClientListResponse) (SecurityPerimetersClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimetersClient.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 SecurityPerimetersClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityPerimetersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *SecurityPerimetersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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() + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityPerimetersClient) listHandleResponse(resp *http.Response) (SecurityPerimetersClientListResponse, error) { + result := SecurityPerimetersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPerimeterListResult); err != nil { + return SecurityPerimetersClientListResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all network security perimeters in a subscription. +// +// Generated from API version 2024-07-01 +// - options - SecurityPerimetersClientListBySubscriptionOptions contains the optional parameters for the SecurityPerimetersClient.NewListBySubscriptionPager +// method. +func (client *SecurityPerimetersClient) NewListBySubscriptionPager(options *SecurityPerimetersClientListBySubscriptionOptions) *runtime.Pager[SecurityPerimetersClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityPerimetersClientListBySubscriptionResponse]{ + More: func(page SecurityPerimetersClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityPerimetersClientListBySubscriptionResponse) (SecurityPerimetersClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SecurityPerimetersClient.NewListBySubscriptionPager") + 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.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return SecurityPerimetersClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *SecurityPerimetersClient) listBySubscriptionCreateRequest(ctx context.Context, options *SecurityPerimetersClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityPerimeters" + if client.subscriptionID == "" { + return 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() + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *SecurityPerimetersClient) listBySubscriptionHandleResponse(resp *http.Response) (SecurityPerimetersClientListBySubscriptionResponse, error) { + result := SecurityPerimetersClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPerimeterListResult); err != nil { + return SecurityPerimetersClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Patch - Patch Tags for a Network Security Perimeter. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *SecurityPerimetersClient) Patch(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters UpdateTagsRequest, options *SecurityPerimetersClientPatchOptions) (SecurityPerimetersClientPatchResponse, error) { + var err error + const operationName = "SecurityPerimetersClient.Patch" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.patchCreateRequest(ctx, resourceGroupName, networkSecurityPerimeterName, parameters, options) + if err != nil { + return SecurityPerimetersClientPatchResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return SecurityPerimetersClientPatchResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPerimetersClientPatchResponse{}, err + } + resp, err := client.patchHandleResponse(httpResp) + return resp, err +} + +// patchCreateRequest creates the Patch request. +func (client *SecurityPerimetersClient) patchCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityPerimeterName string, parameters UpdateTagsRequest, _ *SecurityPerimetersClientPatchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 networkSecurityPerimeterName == "" { + return nil, errors.New("parameter networkSecurityPerimeterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterName}", url.PathEscape(networkSecurityPerimeterName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// patchHandleResponse handles the Patch response. +func (client *SecurityPerimetersClient) patchHandleResponse(resp *http.Response) (SecurityPerimetersClientPatchResponse, error) { + result := SecurityPerimetersClientPatchResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityPerimeter); err != nil { + return SecurityPerimetersClientPatchResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/network/armnetwork/securityrules_client.go b/sdk/resourcemanager/network/armnetwork/securityrules_client.go index 293e80d8f0b6..92b8d94721fe 100644 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *SecurityRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *SecurityRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityRuleParameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *SecurityRulesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *SecurityRulesClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the specified network security rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - securityRuleName - The name of the security rule. @@ -243,7 +240,7 @@ 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, options *SecurityRulesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -266,7 +263,7 @@ func (client *SecurityRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ func (client *SecurityRulesClient) getHandleResponse(resp *http.Response) (Secur // NewListPager - Gets all security rules in a network security group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkSecurityGroupName - The name of the network security group. // - options - SecurityRulesClientListOptions contains the optional parameters for the SecurityRulesClient.NewListPager method. @@ -311,7 +308,7 @@ func (client *SecurityRulesClient) NewListPager(resourceGroupName string, networ } // listCreateRequest creates the List request. -func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, options *SecurityRulesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -330,7 +327,7 @@ func (client *SecurityRulesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 8f7c23f6129d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityrules_client_example_test.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityRulesClient().BeginDelete(ctx, "rg1", "testnsg", "rule1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityRulesClient().Get(ctx, "rg1", "testnsg", "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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityRulesClient().NewListPager("rg1", "testnsg", 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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go index 35bff0c54d1d..78a9928682ab 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -78,7 +75,7 @@ func (client *SecurityUserConfigurationsClient) CreateOrUpdate(ctx context.Conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityUserConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityUserConfiguration SecurityUserConfiguration, options *SecurityUserConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SecurityUserConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, securityUserConfiguration SecurityUserConfiguration, _ *SecurityUserConfigurationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -101,7 +98,7 @@ func (client *SecurityUserConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserConfiguration); err != nil { @@ -122,7 +119,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -149,7 +146,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -195,7 +192,7 @@ func (client *SecurityUserConfigurationsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -207,7 +204,7 @@ func (client *SecurityUserConfigurationsClient) deleteCreateRequest(ctx context. // Get - Retrieves a network manager security user configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -236,7 +233,7 @@ func (client *SecurityUserConfigurationsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *SecurityUserConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, options *SecurityUserConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *SecurityUserConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, _ *SecurityUserConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -259,7 +256,7 @@ func (client *SecurityUserConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +273,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -330,7 +327,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index e97d44cca84c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserconfigurations_client_example_test.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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/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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go index fb839eb34571..381821d71002 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -79,7 +76,7 @@ func (client *SecurityUserRuleCollectionsClient) CreateOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityUserRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, securityUserRuleCollection SecurityUserRuleCollection, options *SecurityUserRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SecurityUserRuleCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, securityUserRuleCollection SecurityUserRuleCollection, _ *SecurityUserRuleCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *SecurityUserRuleCollectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRuleCollection); err != nil { @@ -127,7 +124,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -205,7 +202,7 @@ func (client *SecurityUserRuleCollectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -217,7 +214,7 @@ func (client *SecurityUserRuleCollectionsClient) deleteCreateRequest(ctx context // Get - Gets a network manager security user configuration rule collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -247,7 +244,7 @@ func (client *SecurityUserRuleCollectionsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *SecurityUserRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, options *SecurityUserRuleCollectionsClientGetOptions) (*policy.Request, error) { +func (client *SecurityUserRuleCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, _ *SecurityUserRuleCollectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -274,7 +271,7 @@ func (client *SecurityUserRuleCollectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +288,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -350,7 +347,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 3bd9ffd4f340..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserrulecollections_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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("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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go index 723deeff1b28..4b97b28513b6 100644 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/securityuserrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -80,7 +77,7 @@ func (client *SecurityUserRulesClient) CreateOrUpdate(ctx context.Context, resou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecurityUserRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, securityUserRule SecurityUserRule, options *SecurityUserRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SecurityUserRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, securityUserRule SecurityUserRule, _ *SecurityUserRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -111,7 +108,7 @@ func (client *SecurityUserRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityUserRule); err != nil { @@ -132,7 +129,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -161,7 +158,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -215,7 +212,7 @@ func (client *SecurityUserRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -227,7 +224,7 @@ func (client *SecurityUserRulesClient) deleteCreateRequest(ctx context.Context, // Get - Gets a security user rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -257,7 +254,7 @@ func (client *SecurityUserRulesClient) Get(ctx context.Context, resourceGroupNam } // getCreateRequest creates the Get request. -func (client *SecurityUserRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, options *SecurityUserRulesClientGetOptions) (*policy.Request, error) { +func (client *SecurityUserRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, _ *SecurityUserRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -288,7 +285,7 @@ func (client *SecurityUserRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +302,7 @@ func (client *SecurityUserRulesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Lists all Security User Rules in a rule collection. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -369,7 +366,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index de3755be0df4..000000000000 --- a/sdk/resourcemanager/network/armnetwork/securityuserrules_client_example_test.go +++ /dev/null @@ -1,232 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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/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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go index 88ec56573fd4..b6952d86b272 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -76,7 +73,7 @@ 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, options *ServiceAssociationLinksClientListOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *ServiceAssociationLinksClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 0eaa9e11ffa2..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceassociationlinks_client_example_test.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceAssociationLinksClient().List(ctx, "rg1", "vnet", "subnet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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 f1d7b8d84ae9..db57a445dc7a 100644 --- a/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicecommunity_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go index 7191e5fc30b6..cd8eeabf50d5 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to the create or update service endpoint policy operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *ServiceEndpointPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *ServiceEndpointPoliciesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientBeginDeleteOptions contains the optional parameters for the ServiceEndpointPoliciesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceEndpointPoliciesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *ServiceEndpointPoliciesClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *ServiceEndpointPoliciesClient) deleteCreateRequest(ctx context.Con // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - options - ServiceEndpointPoliciesClientGetOptions contains the optional parameters for the ServiceEndpointPoliciesClient.Get @@ -255,7 +252,7 @@ func (client *ServiceEndpointPoliciesClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +269,7 @@ func (client *ServiceEndpointPoliciesClient) getHandleResponse(resp *http.Respon // NewListPager - Gets all the service endpoint policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - ServiceEndpointPoliciesClientListOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListPager // method. func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpointPoliciesClientListOptions) *runtime.Pager[ServiceEndpointPoliciesClientListResponse] { @@ -299,7 +296,7 @@ func (client *ServiceEndpointPoliciesClient) NewListPager(options *ServiceEndpoi } // listCreateRequest creates the List request. -func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Context, options *ServiceEndpointPoliciesClientListOptions) (*policy.Request, error) { +func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Context, _ *ServiceEndpointPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -310,7 +307,7 @@ func (client *ServiceEndpointPoliciesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +324,7 @@ func (client *ServiceEndpointPoliciesClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Gets all service endpoint Policies in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - ServiceEndpointPoliciesClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPoliciesClient.NewListByResourceGroupPager // method. @@ -355,7 +352,7 @@ func (client *ServiceEndpointPoliciesClient) NewListByResourceGroupPager(resourc } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ServiceEndpointPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -370,7 +367,7 @@ func (client *ServiceEndpointPoliciesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +385,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy. // - parameters - Parameters supplied to update service endpoint policy tags. @@ -417,7 +414,7 @@ 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, options *ServiceEndpointPoliciesClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -436,7 +433,7 @@ func (client *ServiceEndpointPoliciesClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go deleted file mode 100644 index ef1bf3520f5a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicies_client_example_test.go +++ /dev/null @@ -1,397 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPoliciesClient().BeginDelete(ctx, "rg1", "serviceEndpointPolicy1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPoliciesClient().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.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")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.Network/serviceEndpointPolicies"), - // ID: to.Ptr("/subscriptions/subid/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"), - // 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{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPoliciesClient().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.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")}, - // }, - // }}, - // Subnets: []*armnetwork.Subnet{ - // }, - // }, - // }, - // { - // Name: to.Ptr("testServiceEndpointPolicy1"), - // ID: to.Ptr("/subscriptions/subid/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"), - // 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{ - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go index f87876a65cdd..d4f596ded0af 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicy_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go index 6ebb5ac8706c..eb37dbb2f086 100644 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go +++ b/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 name. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *ServiceEndpointPolicyDefinitionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, serviceEndpointPolicyDefinitions); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteOperation(ctx contex } // deleteCreateRequest creates the Delete request. -func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, options *ServiceEndpointPolicyDefinitionsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) deleteCreateRequest(ctx co // Get - Get the specified service endpoint policy definitions from service endpoint policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -244,7 +241,7 @@ 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, options *ServiceEndpointPolicyDefinitionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) getHandleResponse(resp *ht // NewListByResourceGroupPager - Gets all service endpoint policy definitions in a service end point policy. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - serviceEndpointPolicyName - The name of the service endpoint policy name. // - options - ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ServiceEndpointPolicyDefinitionsClient.NewListByResourceGroupPager @@ -313,7 +310,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) NewListByResourceGroupPage } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, options *ServiceEndpointPolicyDefinitionsClientListByResourceGroupOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *ServiceEndpointPolicyDefinitionsClient) listByResourceGroupCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 13f3c0fdda6d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/serviceendpointpolicydefinitions_client_example_test.go +++ /dev/null @@ -1,157 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().BeginDelete(ctx, "rg1", "testPolicy", "testDefinition", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceEndpointPolicyDefinitionsClient().Get(ctx, "rg1", "testPolicy", "testDefinition", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceEndpointPolicyDefinitionsClient().NewListByResourceGroupPager("rg1", "testPolicy", 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.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")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go index f1ec9af1817b..6c7c7b1b17a0 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewServiceTagInformationClient(subscriptionID string, credential azcore.Tok // NewListPager - Gets a list of service tag information resources with pagination. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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). @@ -92,7 +89,7 @@ func (client *ServiceTagInformationClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.NoAddressPrefixes != nil { reqQP.Set("noAddressPrefixes", strconv.FormatBool(*options.NoAddressPrefixes)) } diff --git a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go b/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go deleted file mode 100644 index c4426e019ab3..000000000000 --- a/sdk/resourcemanager/network/armnetwork/servicetaginformation_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: 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.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"), - // }, - // }, - // { - // Name: to.Ptr("ApiManagement.AustraliaCentral"), - // ID: to.Ptr("ApiManagement.AustraliaCentral"), - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: to.Ptr(true), - TagName: 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.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"), - // }, - // }, - // { - // 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceTagInformationClient().NewListPager("westeurope", &armnetwork.ServiceTagInformationClientListOptions{NoAddressPrefixes: nil, - TagName: to.Ptr("ApiManagement"), - }) - 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.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 0cabf8670061..9a14985a7a66 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-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). @@ -75,7 +72,7 @@ func (client *ServiceTagsClient) List(ctx context.Context, location string, opti } // listCreateRequest creates the List request. -func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location string, options *ServiceTagsClientListOptions) (*policy.Request, error) { +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") @@ -90,7 +87,7 @@ func (client *ServiceTagsClient) listCreateRequest(ctx context.Context, location return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 666305a69c86..000000000000 --- a/sdk/resourcemanager/network/armnetwork/servicetags_client_example_test.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceTagsClient().List(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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{ - // 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"), - // }, - // }, - // { - // 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("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"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go index 4b663a631264..11147476a3af 100644 --- a/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/servicetags_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go index edaf2fac7872..12944ddc25ae 100644 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticcidrs_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - IP Address Manager Pool resource name. @@ -104,7 +101,7 @@ func (client *StaticCidrsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 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" @@ -178,7 +175,7 @@ func (client *StaticCidrsClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, _ *StaticCidrsClientBeginDeleteOptions) (*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") @@ -205,7 +202,7 @@ func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *StaticCidrsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specific Static CIDR resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -243,7 +240,7 @@ func (client *StaticCidrsClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *StaticCidrsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, options *StaticCidrsClientGetOptions) (*policy.Request, error) { +func (client *StaticCidrsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, poolName string, staticCidrName string, _ *StaticCidrsClientGetOptions) (*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") @@ -270,7 +267,7 @@ func (client *StaticCidrsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +284,7 @@ func (client *StaticCidrsClient) getHandleResponse(resp *http.Response) (StaticC // NewListPager - Gets list of Static CIDR resources at Network Manager level. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - poolName - Pool resource name. @@ -339,7 +336,7 @@ func (client *StaticCidrsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go deleted file mode 100644 index b10c484a647b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/staticcidrs_client_example_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStaticCidrsClient().Get(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("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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go index 2679ade15584..be38dce3129c 100644 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client.go +++ b/sdk/resourcemanager/network/armnetwork/staticmembers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -79,7 +76,7 @@ func (client *StaticMembersClient) CreateOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, options *StaticMembersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, parameters StaticMember, _ *StaticMembersClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -106,7 +103,7 @@ func (client *StaticMembersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,7 +124,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -155,7 +152,7 @@ func (client *StaticMembersClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientDeleteOptions) (*policy.Request, error) { +func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, _ *StaticMembersClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -182,7 +179,7 @@ func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +188,7 @@ func (client *StaticMembersClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified static member. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -220,7 +217,7 @@ func (client *StaticMembersClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, options *StaticMembersClientGetOptions) (*policy.Request, error) { +func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string, _ *StaticMembersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,7 +244,7 @@ func (client *StaticMembersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +261,7 @@ func (client *StaticMembersClient) getHandleResponse(resp *http.Response) (Stati // NewListPager - Lists the specified static member. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - networkGroupName - The name of the network group. @@ -322,7 +319,7 @@ 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", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 503d94c4485d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/staticmembers_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewStaticMembersClient().Delete(ctx, "SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStaticMembersClient().NewListPager("rg1", "testNetworkManager", "testNetworkGroup", &armnetwork.StaticMembersClientListOptions{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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client.go b/sdk/resourcemanager/network/armnetwork/subnets_client.go index c2a1e3030408..f1f5e0272482 100644 --- a/sdk/resourcemanager/network/armnetwork/subnets_client.go +++ b/sdk/resourcemanager/network/armnetwork/subnets_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *SubnetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *SubnetsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, subnetParameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -159,7 +156,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -182,7 +179,7 @@ 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, options *SubnetsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -205,7 +202,7 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +211,7 @@ func (client *SubnetsClient) deleteCreateRequest(ctx context.Context, resourceGr // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -268,7 +265,7 @@ func (client *SubnetsClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +282,7 @@ func (client *SubnetsClient) getHandleResponse(resp *http.Response) (SubnetsClie // NewListPager - Gets all subnets in a virtual network. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - SubnetsClientListOptions contains the optional parameters for the SubnetsClient.NewListPager method. @@ -313,7 +310,7 @@ func (client *SubnetsClient) NewListPager(resourceGroupName string, virtualNetwo } // listCreateRequest creates the List request. -func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *SubnetsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *SubnetsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +347,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -378,7 +375,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -401,7 +398,7 @@ 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, options *SubnetsClientBeginPrepareNetworkPoliciesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -424,7 +421,7 @@ func (client *SubnetsClient) prepareNetworkPoliciesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, prepareNetworkPoliciesRequestParameters); err != nil { @@ -436,7 +433,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - subnetName - The name of the subnet. @@ -464,7 +461,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -487,7 +484,7 @@ 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, options *SubnetsClientBeginUnprepareNetworkPoliciesOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -510,7 +507,7 @@ func (client *SubnetsClient) unprepareNetworkPoliciesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, unprepareNetworkPoliciesRequestParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go b/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go deleted file mode 100644 index 35df29329f02..000000000000 --- a/sdk/resourcemanager/network/armnetwork/subnets_client_example_test.go +++ /dev/null @@ -1,452 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubnetsClient().BeginDelete(ctx, "subnet-test", "vnetname", "subnet1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // 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(""), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Service: to.Ptr("Microsoft.Storage"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - _, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go index 17cddc29cefb..65ff6195d559 100644 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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 @@ -76,7 +73,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) CreateOrUpdate(ctx co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, options *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, networkManagerConnectionName string, parameters ManagerConnection, _ *SubscriptionNetworkManagerConnectionsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -91,7 +88,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) createOrUpdateCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -112,7 +109,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientDeleteOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Delete // method. @@ -138,7 +135,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) Delete(ctx context.Co } // deleteCreateRequest creates the Delete request. -func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(ctx context.Context, networkManagerConnectionName string, _ *SubscriptionNetworkManagerConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -153,7 +150,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +159,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) deleteCreateRequest(c // Get - Get a specified connection created by this subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - networkManagerConnectionName - Name for the network manager connection. // - options - SubscriptionNetworkManagerConnectionsClientGetOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.Get // method. @@ -189,7 +186,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) Get(ctx context.Conte } // getCreateRequest creates the Get request. -func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, networkManagerConnectionName string, options *SubscriptionNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { +func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx context.Context, networkManagerConnectionName string, _ *SubscriptionNetworkManagerConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -204,7 +201,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +218,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) getHandleResponse(res // NewListPager - List all network manager connections created by this subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - SubscriptionNetworkManagerConnectionsClientListOptions contains the optional parameters for the SubscriptionNetworkManagerConnectionsClient.NewListPager // method. func (client *SubscriptionNetworkManagerConnectionsClient) NewListPager(options *SubscriptionNetworkManagerConnectionsClientListOptions) *runtime.Pager[SubscriptionNetworkManagerConnectionsClientListResponse] { @@ -265,7 +262,7 @@ func (client *SubscriptionNetworkManagerConnectionsClient) listCreateRequest(ctx if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 2da2a71b0371..000000000000 --- a/sdk/resourcemanager/network/armnetwork/subscriptionnetworkmanagerconnections_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSubscriptionNetworkManagerConnectionsClient().Delete(ctx, "TestNMConnection", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionNetworkManagerConnectionsClient().NewListPager(&armnetwork.SubscriptionNetworkManagerConnectionsClientListOptions{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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/time_rfc3339.go b/sdk/resourcemanager/network/armnetwork/time_rfc3339.go index 562771d6dc56..5be5b3637577 100644 --- a/sdk/resourcemanager/network/armnetwork/time_rfc3339.go +++ b/sdk/resourcemanager/network/armnetwork/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } 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 diff --git a/sdk/resourcemanager/network/armnetwork/usage_live_test.go b/sdk/resourcemanager/network/armnetwork/usage_live_test.go index 8209a2f17573..6ebb01fa8f55 100644 --- a/sdk/resourcemanager/network/armnetwork/usage_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/usage_live_test.go @@ -15,7 +15,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/usages_client.go b/sdk/resourcemanager/network/armnetwork/usages_client.go index 83fc19a28178..706cc8c1583c 100644 --- a/sdk/resourcemanager/network/armnetwork/usages_client.go +++ b/sdk/resourcemanager/network/armnetwork/usages_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - List network usages for a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - location - The location where resource usage is queried. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -73,7 +70,7 @@ func (client *UsagesClient) NewListPager(location string, options *UsagesClientL } // listCreateRequest creates the List request. -func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { +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") @@ -88,7 +85,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index c0ff109a20e9..000000000000 --- a/sdk/resourcemanager/network/armnetwork/usages_client_example_test.go +++ /dev/null @@ -1,644 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("westus", 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.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), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("West US", 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.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), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go index e79397af3b1e..c4a28c885d90 100644 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go +++ b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -78,7 +75,7 @@ func (client *VerifierWorkspacesClient) Create(ctx context.Context, resourceGrou } // createCreateRequest creates the Create request. -func (client *VerifierWorkspacesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body VerifierWorkspace, options *VerifierWorkspacesClientCreateOptions) (*policy.Request, error) { +func (client *VerifierWorkspacesClient) createCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, body VerifierWorkspace, _ *VerifierWorkspacesClientCreateOptions) (*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") @@ -101,7 +98,7 @@ func (client *VerifierWorkspacesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -122,7 +119,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -149,7 +146,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 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" @@ -172,7 +169,7 @@ func (client *VerifierWorkspacesClient) deleteOperation(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, _ *VerifierWorkspacesClientBeginDeleteOptions) (*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") @@ -195,7 +192,7 @@ func (client *VerifierWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -232,7 +229,7 @@ func (client *VerifierWorkspacesClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *VerifierWorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, options *VerifierWorkspacesClientGetOptions) (*policy.Request, error) { +func (client *VerifierWorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkManagerName string, workspaceName string, _ *VerifierWorkspacesClientGetOptions) (*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") @@ -255,7 +252,7 @@ func (client *VerifierWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +269,7 @@ func (client *VerifierWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets list of Verifier Workspaces. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - options - VerifierWorkspacesClientListOptions contains the optional parameters for the VerifierWorkspacesClient.NewListPager @@ -320,7 +317,7 @@ func (client *VerifierWorkspacesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Skip != nil { reqQP.Set("skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -353,7 +350,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkManagerName - The name of the network manager. // - workspaceName - Workspace name. @@ -405,7 +402,7 @@ func (client *VerifierWorkspacesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go b/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go deleted file mode 100644 index 72add1a1c6ca..000000000000 --- a/sdk/resourcemanager/network/armnetwork/verifierworkspaces_client_example_test.go +++ /dev/null @@ -1,213 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - // Properties: &armnetwork.VerifierWorkspaceProperties{ - // Description: to.Ptr("A sample verfier workspace"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVerifierWorkspacesClient().Update(ctx, "rg1", "testNetworkManager", "testWorkspace", &armnetwork.VerifierWorkspacesClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVerifierWorkspacesClient().BeginDelete(ctx, "rg1", "testNetworkManager", "testWorkspace", 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/vipswap_client.go b/sdk/resourcemanager/network/armnetwork/vipswap_client.go index 22f2fc392351..25c929b1b7dd 100644 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client.go +++ b/sdk/resourcemanager/network/armnetwork/vipswap_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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. @@ -72,7 +69,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -95,7 +92,7 @@ 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, options *VipSwapClientBeginCreateOptions) (*policy.Request, error) { +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}" if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") @@ -115,7 +112,7 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ func (client *VipSwapClient) createCreateRequest(ctx context.Context, groupName // can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -155,7 +152,7 @@ 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, options *VipSwapClientGetOptions) (*policy.Request, error) { +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}" if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") @@ -175,7 +172,7 @@ func (client *VipSwapClient) getCreateRequest(ctx context.Context, groupName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +191,7 @@ func (client *VipSwapClient) getHandleResponse(resp *http.Response) (VipSwapClie // cloud service can either be Staging or Production // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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. @@ -221,7 +218,7 @@ 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, options *VipSwapClientListOptions) (*policy.Request, error) { +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" if groupName == "" { return nil, errors.New("parameter groupName cannot be empty") @@ -240,7 +237,7 @@ func (client *VipSwapClient) listCreateRequest(ctx context.Context, groupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 6f6182a28bb2..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vipswap_client_example_test.go +++ /dev/null @@ -1,103 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVipSwapClient().Get(ctx, "rg1", "testCloudService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVipSwapClient().List(ctx, "rg1", "testCloudService", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go index eaec923da35e..247642dacac7 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewVirtualApplianceConnectionsClient(subscriptionID string, credential azco // NVA connection' // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -76,7 +73,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -99,7 +96,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, networkVirtualApplianceConnectionParameters VirtualApplianceConnection, options *VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, networkVirtualApplianceConnectionParameters VirtualApplianceConnection, _ *VirtualApplianceConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -122,7 +119,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, networkVirtualApplianceConnectionParameters); err != nil { @@ -134,7 +131,7 @@ func (client *VirtualApplianceConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a NVA connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -161,7 +158,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -184,7 +181,7 @@ func (client *VirtualApplianceConnectionsClient) deleteOperation(ctx context.Con } // deleteCreateRequest creates the Delete request. -func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, _ *VirtualApplianceConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -207,7 +204,7 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +213,7 @@ func (client *VirtualApplianceConnectionsClient) deleteCreateRequest(ctx context // Get - Retrieves the details of specified NVA connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - connectionName - The name of the NVA connection. @@ -245,7 +242,7 @@ func (client *VirtualApplianceConnectionsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, options *VirtualApplianceConnectionsClientGetOptions) (*policy.Request, error) { +func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, connectionName string, _ *VirtualApplianceConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -268,7 +265,7 @@ func (client *VirtualApplianceConnectionsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +282,7 @@ func (client *VirtualApplianceConnectionsClient) getHandleResponse(resp *http.Re // NewListPager - Lists NetworkVirtualApplianceConnections under the NVA. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - options - VirtualApplianceConnectionsClientListOptions contains the optional parameters for the VirtualApplianceConnectionsClient.NewListPager @@ -314,7 +311,7 @@ func (client *VirtualApplianceConnectionsClient) NewListPager(resourceGroupName } // listCreateRequest creates the List request. -func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceConnectionsClientListOptions) (*policy.Request, error) { +func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, _ *VirtualApplianceConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -333,7 +330,7 @@ func (client *VirtualApplianceConnectionsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index b103e1289b73..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceconnections_client_example_test.go +++ /dev/null @@ -1,237 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "nva1", "connection1", armnetwork.VirtualApplianceConnection{ - 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")}, - EnableInternetSecurity: to.Ptr(false), - 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"), - }, - 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")}, - }, - }, - TunnelIdentifier: to.Ptr[int64](0), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualApplianceConnection = armnetwork.VirtualApplianceConnection{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkVirtualAppliances/nva1/networkVirtualApplianceConnections/connection1"), - // Name: to.Ptr("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"), - // }, - // 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/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceConnectionsClient().Get(ctx, "rg1", "nva1", "connection1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // 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"), - // }, - // 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/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceConnectionsClient().NewListPager("rg1", "nva1", 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.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{ - // 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"), - // }, - // 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/virtualHub1/hubRouteTables/hubRouteTable1"), - // }}, - // Labels: []*string{ - // to.Ptr("label1")}, - // }, - // }, - // TunnelIdentifier: to.Ptr[int64](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go index 980e7addad4a..d00cfbfdda7b 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliances_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - parameters - Parameters supplied to the create or update Network Virtual Appliance. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *VirtualAppliancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *VirtualAppliancesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginDeleteOptions contains the optional parameters for the VirtualAppliancesClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *VirtualAppliancesClient) deleteOperation(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *VirtualAppliancesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the specified Network Virtual Appliance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientGetOptions contains the optional parameters for the VirtualAppliancesClient.Get method. @@ -254,7 +251,7 @@ func (client *VirtualAppliancesClient) getCreateRequest(ctx context.Context, res if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,9 +266,92 @@ func (client *VirtualAppliancesClient) getHandleResponse(resp *http.Response) (V return result, nil } +// 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - 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 +// method. +func (client *VirtualAppliancesClient) BeginGetBootDiagnosticLogs(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, request VirtualApplianceBootDiagnosticParameters, options *VirtualAppliancesClientBeginGetBootDiagnosticLogsOptions) (*runtime.Poller[VirtualAppliancesClientGetBootDiagnosticLogsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getBootDiagnosticLogs(ctx, resourceGroupName, networkVirtualApplianceName, request, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientGetBootDiagnosticLogsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualAppliancesClientGetBootDiagnosticLogsResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-07-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" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getBootDiagnosticLogsCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, request, 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 +} + +// 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 resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil +} + // NewListPager - Gets all Network Virtual Appliances in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualAppliancesClientListOptions contains the optional parameters for the VirtualAppliancesClient.NewListPager // method. func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesClientListOptions) *runtime.Pager[VirtualAppliancesClientListResponse] { @@ -298,7 +378,7 @@ func (client *VirtualAppliancesClient) NewListPager(options *VirtualAppliancesCl } // listCreateRequest creates the List request. -func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, options *VirtualAppliancesClientListOptions) (*policy.Request, error) { +func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, _ *VirtualAppliancesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -309,7 +389,7 @@ func (client *VirtualAppliancesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +406,7 @@ func (client *VirtualAppliancesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Lists all Network Virtual Appliances in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualAppliancesClientListByResourceGroupOptions contains the optional parameters for the VirtualAppliancesClient.NewListByResourceGroupPager // method. @@ -354,7 +434,7 @@ func (client *VirtualAppliancesClient) NewListByResourceGroupPager(resourceGroup } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualAppliancesClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -369,7 +449,7 @@ func (client *VirtualAppliancesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,10 +464,93 @@ func (client *VirtualAppliancesClient) listByResourceGroupHandleResponse(resp *h return result, nil } +// 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - networkVirtualApplianceName - The name of Network Virtual Appliance. +// - options - VirtualAppliancesClientBeginReimageOptions contains the optional parameters for the VirtualAppliancesClient.BeginReimage +// method. +func (client *VirtualAppliancesClient) BeginReimage(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*runtime.Poller[VirtualAppliancesClientReimageResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reimage(ctx, resourceGroupName, networkVirtualApplianceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualAppliancesClientReimageResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualAppliancesClientReimageResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-07-01 +func (client *VirtualAppliancesClient) reimage(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginReimageOptions) (*http.Response, error) { + var err error + const operationName = "VirtualAppliancesClient.BeginReimage" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reimageCreateRequest(ctx, resourceGroupName, networkVirtualApplianceName, 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 +} + +// 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 resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkVirtualApplianceName == "" { + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { + if err := runtime.MarshalAsJSON(req, *options.NetworkVirtualApplianceInstanceIDs); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of Network Virtual Appliance. // - options - VirtualAppliancesClientBeginRestartOptions contains the optional parameters for the VirtualAppliancesClient.BeginRestart @@ -413,7 +576,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualAppliancesClient) restart(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualAppliancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualAppliancesClient.BeginRestart" @@ -455,7 +618,7 @@ func (client *VirtualAppliancesClient) restartCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.NetworkVirtualApplianceInstanceIDs != nil { @@ -470,7 +633,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of Network Virtual Appliance. // - networkVirtualApplianceName - The name of Network Virtual Appliance being updated. // - parameters - Parameters supplied to Update Network Virtual Appliance Tags. @@ -499,7 +662,7 @@ func (client *VirtualAppliancesClient) UpdateTags(ctx context.Context, resourceG } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, options *VirtualAppliancesClientUpdateTagsOptions) (*policy.Request, error) { +func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject, _ *VirtualAppliancesClientUpdateTagsOptions) (*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") @@ -518,7 +681,7 @@ func (client *VirtualAppliancesClient) updateTagsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go deleted file mode 100644 index b8e29982c022..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualappliances_client_example_test.go +++ /dev/null @@ -1,916 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualAppliancesClient().BeginDelete(ctx, "rg1", "nva", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // 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{ - // { - // 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"), - // }, - // 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("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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // }, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - { - 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/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\\"), - // 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{ - // 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{ - // { - // 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"), - // }, - // 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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // 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"), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualAppliancesClient().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.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{ - // }, - // }, - // }, - // 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{ - // { - // 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"), - // }, - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualAppliancesClient().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.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{ - // }, - // }, - // }, - // 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{ - // { - // 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"), - // }, - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go index df655b0979cc..3d9a88d0c3b1 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *VirtualApplianceSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *VirtualApplianceSitesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *VirtualApplianceSitesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *VirtualApplianceSitesClient) deleteCreateRequest(ctx context.Conte // Get - Gets the specified Virtual Appliance Site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - siteName - The name of the site. @@ -244,7 +241,7 @@ 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, options *VirtualApplianceSitesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualApplianceSitesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *VirtualApplianceSitesClient) getHandleResponse(resp *http.Response // NewListPager - Lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkVirtualApplianceName - The name of the Network Virtual Appliance. // - options - VirtualApplianceSitesClientListOptions contains the optional parameters for the VirtualApplianceSitesClient.NewListPager @@ -313,7 +310,7 @@ func (client *VirtualApplianceSitesClient) NewListPager(resourceGroupName string } // listCreateRequest creates the List request. -func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, options *VirtualApplianceSitesClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *VirtualApplianceSitesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 903fd02a26c8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualappliancesites_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualApplianceSitesClient().BeginDelete(ctx, "rg1", "nva", "site1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualApplianceSitesClient().Get(ctx, "rg1", "nva", "site1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceSitesClient().NewListPager("rg1", "nva", 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.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), - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go index eda4bf2c30e6..f5802c174f80 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - skuName - Name of the Sku. // - options - VirtualApplianceSKUsClientGetOptions contains the optional parameters for the VirtualApplianceSKUsClient.Get // method. @@ -74,7 +71,7 @@ func (client *VirtualApplianceSKUsClient) Get(ctx context.Context, skuName strin } // getCreateRequest creates the Get request. -func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, skuName string, options *VirtualApplianceSKUsClientGetOptions) (*policy.Request, error) { +func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, skuName string, _ *VirtualApplianceSKUsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,7 +86,7 @@ func (client *VirtualApplianceSKUsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +103,7 @@ func (client *VirtualApplianceSKUsClient) getHandleResponse(resp *http.Response) // NewListPager - List all SKUs available for a virtual appliance. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualApplianceSKUsClientListOptions contains the optional parameters for the VirtualApplianceSKUsClient.NewListPager // method. func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualApplianceSKUsClientListOptions) *runtime.Pager[VirtualApplianceSKUsClientListResponse] { @@ -133,7 +130,7 @@ func (client *VirtualApplianceSKUsClient) NewListPager(options *VirtualAppliance } // listCreateRequest creates the List request. -func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, options *VirtualApplianceSKUsClientListOptions) (*policy.Request, error) { +func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, _ *VirtualApplianceSKUsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -144,7 +141,7 @@ func (client *VirtualApplianceSKUsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7d97591b192d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualapplianceskus_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualApplianceSKUsClient().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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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 d9a2826d5d87..8dd91325370a 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, options *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection, _ *VirtualHubBgpConnectionClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *VirtualHubBgpConnectionClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *VirtualHubBgpConnectionClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, _ *VirtualHubBgpConnectionClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *VirtualHubBgpConnectionClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a Virtual Hub Bgp Connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - connectionName - The name of the connection. @@ -244,7 +241,7 @@ func (client *VirtualHubBgpConnectionClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, options *VirtualHubBgpConnectionClientGetOptions) (*policy.Request, error) { +func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, _ *VirtualHubBgpConnectionClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualHubBgpConnectionClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 200a16262803..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnection_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubBgpConnectionClient().Get(ctx, "rg1", "hub1", "conn1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubBgpConnectionClient().BeginDelete(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) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go index fb9a530f13e2..7cf7afbe1d25 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVirtualHubBgpConnectionsClient(subscriptionID string, credential azcore. // NewListPager - Retrieves the details of all VirtualHubBgpConnections. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubBgpConnectionsClientListOptions contains the optional parameters for the VirtualHubBgpConnectionsClient.NewListPager @@ -75,7 +72,7 @@ func (client *VirtualHubBgpConnectionsClient) NewListPager(resourceGroupName str } // listCreateRequest creates the List request. -func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubBgpConnectionsClientListOptions) (*policy.Request, error) { +func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *VirtualHubBgpConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +91,7 @@ func (client *VirtualHubBgpConnectionsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +109,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -139,7 +136,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -162,7 +159,7 @@ 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, options *VirtualHubBgpConnectionsClientBeginListAdvertisedRoutesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -185,7 +182,7 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +191,7 @@ func (client *VirtualHubBgpConnectionsClient) listAdvertisedRoutesCreateRequest( // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - hubName - The name of the virtual hub. // - connectionName - The name of the virtual hub bgp connection. @@ -221,7 +218,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -244,7 +241,7 @@ 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, options *VirtualHubBgpConnectionsClientBeginListLearnedRoutesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualHubBgpConnectionsClient) listLearnedRoutesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 59b54a36a7ac..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubbgpconnections_client_example_test.go +++ /dev/null @@ -1,206 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubBgpConnectionsClient().NewListPager("rg1", "hub1", 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // { - // 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), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // { - // 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), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go index 3883354cfa51..76b1fe66e8ae 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, options *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, parameters HubIPConfiguration, _ *VirtualHubIPConfigurationClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ func (client *VirtualHubIPConfigurationClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes a VirtualHubIpConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubBgpConnection. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *VirtualHubIPConfigurationClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, _ *VirtualHubIPConfigurationClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *VirtualHubIPConfigurationClient) deleteCreateRequest(ctx context.C // Get - Retrieves the details of a Virtual Hub Ip configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - ipConfigName - The name of the ipconfig. @@ -244,7 +241,7 @@ func (client *VirtualHubIPConfigurationClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, options *VirtualHubIPConfigurationClientGetOptions) (*policy.Request, error) { +func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, ipConfigName string, _ *VirtualHubIPConfigurationClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualHubIPConfigurationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *VirtualHubIPConfigurationClient) getHandleResponse(resp *http.Resp // NewListPager - Retrieves the details of all VirtualHubIpConfigurations. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubIPConfigurationClientListOptions contains the optional parameters for the VirtualHubIPConfigurationClient.NewListPager @@ -313,7 +310,7 @@ func (client *VirtualHubIPConfigurationClient) NewListPager(resourceGroupName st } // listCreateRequest creates the List request. -func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubIPConfigurationClientListOptions) (*policy.Request, error) { +func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *VirtualHubIPConfigurationClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *VirtualHubIPConfigurationClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index ab9130d8c700..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubipconfiguration_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHubIPConfigurationClient().Get(ctx, "rg1", "hub1", "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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubIPConfigurationClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubIPConfigurationClient().NewListPager("rg1", "hub1", 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.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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go index 4db2ee781c96..05605bed6d40 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, options *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2, _ *VirtualHubRouteTableV2SClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,7 +118,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubRouteTableV2Parameters); err != nil { @@ -133,7 +130,7 @@ func (client *VirtualHubRouteTableV2SClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, _ *VirtualHubRouteTableV2SClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *VirtualHubRouteTableV2SClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a VirtualHubRouteTableV2. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHubRouteTableV2. // - virtualHubName - The name of the VirtualHub. // - routeTableName - The name of the VirtualHubRouteTableV2. @@ -244,7 +241,7 @@ func (client *VirtualHubRouteTableV2SClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, options *VirtualHubRouteTableV2SClientGetOptions) (*policy.Request, error) { +func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, _ *VirtualHubRouteTableV2SClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualHubRouteTableV2SClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *VirtualHubRouteTableV2SClient) getHandleResponse(resp *http.Respon // NewListPager - Retrieves the details of all VirtualHubRouteTableV2s. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubRouteTableV2SClientListOptions contains the optional parameters for the VirtualHubRouteTableV2SClient.NewListPager @@ -313,7 +310,7 @@ func (client *VirtualHubRouteTableV2SClient) NewListPager(resourceGroupName stri } // listCreateRequest creates the List request. -func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubRouteTableV2SClientListOptions) (*policy.Request, error) { +func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *VirtualHubRouteTableV2SClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *VirtualHubRouteTableV2SClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 13aa74dc8482..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubroutetablev2s_client_example_test.go +++ /dev/null @@ -1,190 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - 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")}, - }}, - }, - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubRouteTableV2SClient().BeginDelete(ctx, "rg1", "virtualHub1", "virtualHubRouteTable1a", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHubRouteTableV2SClient().NewListPager("rg1", "virtualHub1", 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.ListVirtualHubRouteTableV2SResult = armnetwork.ListVirtualHubRouteTableV2SResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go index d9fb4e8cf708..9f11cb647a6e 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualhubs_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to create or update VirtualHub. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VirtualHubsClient) createOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, options *VirtualHubsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub, _ *VirtualHubsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *VirtualHubsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginDeleteOptions contains the optional parameters for the VirtualHubsClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *VirtualHubsClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *VirtualHubsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -195,7 +192,7 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *VirtualHubsClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a VirtualHub. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientGetOptions contains the optional parameters for the VirtualHubsClient.Get method. @@ -231,7 +228,7 @@ func (client *VirtualHubsClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientGetOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, _ *VirtualHubsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +247,7 @@ func (client *VirtualHubsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *VirtualHubsClient) getHandleResponse(resp *http.Response) (Virtual // resource . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - options - VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions contains the optional parameters for the VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes @@ -296,7 +293,7 @@ func (client *VirtualHubsClient) BeginGetEffectiveVirtualHubRoutes(ctx context.C // . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualHubsClient) getEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, options *VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualHubsClient.BeginGetEffectiveVirtualHubRoutes" @@ -338,7 +335,7 @@ func (client *VirtualHubsClient) getEffectiveVirtualHubRoutesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.EffectiveRoutesParameters != nil { @@ -353,7 +350,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - getInboundRoutesParameters - Parameters supplied to get the inbound routes for a connection resource. @@ -380,7 +377,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -403,7 +400,7 @@ func (client *VirtualHubsClient) getInboundRoutes(ctx context.Context, resourceG } // getInboundRoutesCreateRequest creates the GetInboundRoutes request. -func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, options *VirtualHubsClientBeginGetInboundRoutesOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters, _ *VirtualHubsClientBeginGetInboundRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -422,7 +419,7 @@ func (client *VirtualHubsClient) getInboundRoutesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getInboundRoutesParameters); err != nil { @@ -434,7 +431,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - getOutboundRoutesParameters - Parameters supplied to get the outbound routes for a connection resource. @@ -461,7 +458,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -484,7 +481,7 @@ func (client *VirtualHubsClient) getOutboundRoutes(ctx context.Context, resource } // getOutboundRoutesCreateRequest creates the GetOutboundRoutes request. -func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, options *VirtualHubsClientBeginGetOutboundRoutesOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters, _ *VirtualHubsClientBeginGetOutboundRoutesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -503,7 +500,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, getOutboundRoutesParameters); err != nil { @@ -514,7 +511,7 @@ func (client *VirtualHubsClient) getOutboundRoutesCreateRequest(ctx context.Cont // NewListPager - Lists all the VirtualHubs in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -540,7 +537,7 @@ func (client *VirtualHubsClient) NewListPager(options *VirtualHubsClientListOpti } // listCreateRequest creates the List request. -func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options *VirtualHubsClientListOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, _ *VirtualHubsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -551,7 +548,7 @@ func (client *VirtualHubsClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -568,7 +565,7 @@ func (client *VirtualHubsClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualHubs in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - options - VirtualHubsClientListByResourceGroupOptions contains the optional parameters for the VirtualHubsClient.NewListByResourceGroupPager // method. @@ -596,7 +593,7 @@ func (client *VirtualHubsClient) NewListByResourceGroupPager(resourceGroupName s } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualHubsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualHubsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -611,7 +608,7 @@ func (client *VirtualHubsClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -629,7 +626,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualHub. // - virtualHubName - The name of the VirtualHub. // - virtualHubParameters - Parameters supplied to update VirtualHub tags. @@ -657,7 +654,7 @@ func (client *VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupNa } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, options *VirtualHubsClientUpdateTagsOptions) (*policy.Request, error) { +func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject, _ *VirtualHubsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -676,7 +673,7 @@ func (client *VirtualHubsClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, virtualHubParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go deleted file mode 100644 index 692b74398cb1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualhubs_client_example_test.go +++ /dev/null @@ -1,706 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, - }, nil) - if 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.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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginDelete(ctx, "rg1", "virtualHub1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }) - if 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }) - if 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHubsClient().BeginGetEffectiveVirtualHubRoutes(ctx, "rg1", "virtualHub1", &armnetwork.VirtualHubsClientBeginGetEffectiveVirtualHubRoutesOptions{EffectiveRoutesParameters: nil}) - if 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.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"), - // }, - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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"), - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go index 8db5e9619900..333f62f2acbe 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetwork_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go index 248784fac28f..80d5d97ddc99 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateway_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go index d91656dfd2c1..5b6478d6b457 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to the create or update virtual network gateway connection operation. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdate(ctx context } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, options *VirtualNetworkGatewayConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteOperation(ctx contex } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) deleteCreateRequest(ctx co // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientGetOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.Get @@ -233,7 +230,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, r } // getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - options - VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas @@ -296,7 +293,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginGetIkeSas" @@ -319,7 +316,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSas(ctx context.Cont } // getIkeSasCreateRequest creates the GetIkeSas request. -func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -338,7 +335,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +345,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getIkeSasCreateRequest(ctx // network gateway connection shared key through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection shared key name. // - options - VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.GetSharedKey @@ -376,7 +373,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.C } // getSharedKeyCreateRequest creates the GetSharedKey request. -func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientGetSharedKeyOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -395,7 +392,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +410,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) getSharedKeyHandleResponse // NewListPager - The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections // created. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewayConnectionsClientListOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.NewListPager // method. @@ -441,7 +438,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) NewListPager(resourceGroup } // listCreateRequest creates the List request. -func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewayConnectionsClientListOptions) (*policy.Request, error) { +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") @@ -456,7 +453,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -474,7 +471,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - options - VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions contains the optional parameters for the VirtualNetworkGatewayConnectionsClient.BeginResetConnection @@ -500,7 +497,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginResetConnection" @@ -523,7 +520,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnection(ctx contex } // resetConnectionCreateRequest creates the ResetConnection request. -func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -542,7 +539,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -553,7 +550,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetConnectionCreateReque // through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection reset shared key Name. // - parameters - Parameters supplied to the begin reset virtual network gateway connection shared key operation through network @@ -583,7 +580,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginResetSharedKey(ctx co // through Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -606,7 +603,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKey(ctx context } // resetSharedKeyCreateRequest creates the ResetSharedKey request. -func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, options *VirtualNetworkGatewayConnectionsClientBeginResetSharedKeyOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -625,7 +622,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -639,7 +636,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) resetSharedKeyCreateReques // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The virtual network gateway connection name. // - parameters - Parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation throughNetwork @@ -669,7 +666,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) BeginSetSharedKey(ctx cont // Network resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -692,7 +689,7 @@ 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, options *VirtualNetworkGatewayConnectionsClientBeginSetSharedKeyOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -711,7 +708,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) setSharedKeyCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -723,7 +720,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - options - VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions contains the optional parameters for the @@ -749,7 +746,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewayConnectionsClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, options *VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewayConnectionsClient.BeginStartPacketCapture" @@ -791,7 +788,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) startPacketCaptureCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -806,7 +803,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway Connection. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway connection. @@ -833,7 +830,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -856,7 +853,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCapture(ctx cont } // stopPacketCaptureCreateRequest creates the StopPacketCapture request. -func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNPacketCaptureStopParameters, options *VirtualNetworkGatewayConnectionsClientBeginStopPacketCaptureOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -875,7 +872,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) stopPacketCaptureCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -887,7 +884,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection. // - parameters - Parameters supplied to update virtual network gateway connection tags. @@ -914,7 +911,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -937,7 +934,7 @@ 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, options *VirtualNetworkGatewayConnectionsClientBeginUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -956,7 +953,7 @@ func (client *VirtualNetworkGatewayConnectionsClient) updateTagsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go deleted file mode 100644 index 656f1c2eb251..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewayconnections_client_example_test.go +++ /dev/null @@ -1,689 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "connS2S", armnetwork.VirtualNetworkGatewayConnection{ - Location: to.Ptr("centralus"), - Properties: &armnetwork.VirtualNetworkGatewayConnectionPropertiesFormat{ - ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - ConnectionType: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionTypeIPsec), - DpdTimeoutSeconds: to.Ptr[int32](30), - 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"), - }}, - 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/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")}, - }, - }, - }, - RoutingWeight: to.Ptr[int32](0), - SharedKey: to.Ptr("Abc123"), - TrafficSelectorPolicies: []*armnetwork.TrafficSelectorPolicy{}, - UsePolicyBasedTrafficSelectors: to.Ptr(false), - VirtualNetworkGateway1: &armnetwork.VirtualNetworkGateway{ - ID: to.Ptr("/subscriptions/subid/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{ - Asn: to.Ptr[int64](65514), - BgpPeeringAddress: to.Ptr("10.0.1.30"), - PeerWeight: to.Ptr[int32](0), - }, - EnableBgp: 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"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - 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"), - }, - }, - }}, - SKU: &armnetwork.VirtualNetworkGatewaySKU{ - Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - }, - VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - }, - }, - }, - }, nil) - if 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("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{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // 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/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/localgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("Abc123"), - // UseLocalAzureIPAddress: to.Ptr(false), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().Get(ctx, "rg1", "connS2S", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // ConnectionMode: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionModeDefault), - // ConnectionProtocol: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionProtocolIKEv2), - // ConnectionStatus: to.Ptr(armnetwork.VirtualNetworkGatewayConnectionStatusConnecting), - // 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/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/localgw"), - // Properties: &armnetwork.LocalNetworkGatewayPropertiesFormat{ - // }, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // RoutingWeight: to.Ptr[int32](0), - // SharedKey: to.Ptr("Abc123"), - // 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/vpngw"), - // Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // SharedKey: to.Ptr("temp1234"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.ConnectionSharedKey = armnetwork.ConnectionSharedKey{ - // ID: to.Ptr(""), - // Value: to.Ptr("AzureAbc123"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().GetSharedKey(ctx, "rg1", "connS2S", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewayConnectionsClient().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.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"), - // }, - // { - // 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{ - // }, - // }, - // 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{ - // }, - // }, - // }, - // }, - // { - // 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"), - // }, - // { - // 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{ - // }, - // }, - // 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{ - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginResetSharedKey(ctx, "rg1", "conn1", armnetwork.ConnectionResetSharedKey{ - KeyLength: to.Ptr[int32](128), - }, nil) - if 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.ConnectionResetSharedKey = armnetwork.ConnectionResetSharedKey{ - // KeyLength: to.Ptr[int32](128), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}]}"), - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayConnectionsClient().BeginStartPacketCapture(ctx, "rg1", "vpngwcn1", &armnetwork.VirtualNetworkGatewayConnectionsClientBeginStartPacketCaptureOptions{Parameters: nil}) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go index 4253dd3a146b..e409547bcab4 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string, credential az // nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -77,7 +74,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) BeginCreateOrUpdate(ctx conte // nat rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -100,7 +97,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdate(ctx context.Co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, options *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule, _ *VirtualNetworkGatewayNatRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -123,7 +120,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, natRuleParameters); err != nil { @@ -135,7 +132,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -162,7 +159,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -185,7 +182,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteOperation(ctx context.C } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, _ *VirtualNetworkGatewayNatRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -208,7 +205,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +214,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) deleteCreateRequest(ctx conte // Get - Retrieves the details of a nat rule. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the Virtual Network Gateway. // - virtualNetworkGatewayName - The name of the gateway. // - natRuleName - The name of the nat rule. @@ -246,7 +243,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) Get(ctx context.Context, reso } // getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, options *VirtualNetworkGatewayNatRulesClientGetOptions) (*policy.Request, error) { +func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, _ *VirtualNetworkGatewayNatRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -269,7 +266,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +283,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) getHandleResponse(resp *http. // NewListByVirtualNetworkGatewayPager - Retrieves all nat rules for a particular virtual network gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the virtual network gateway. // - virtualNetworkGatewayName - The name of the gateway. // - options - VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions contains the optional parameters for the @@ -315,7 +312,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) NewListByVirtualNetworkGatewa } // listByVirtualNetworkGatewayCreateRequest creates the ListByVirtualNetworkGateway request. -func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) (*policy.Request, error) { +func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewayNatRulesClientListByVirtualNetworkGatewayOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -334,7 +331,7 @@ func (client *VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index fc432232fed7..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgatewaynatrules_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().BeginCreateOrUpdate(ctx, "rg1", "gateway1", "natRule1", armnetwork.VirtualNetworkGatewayNatRule{ - 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), - }, - }, nil) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewayNatRulesClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkGatewayNatRulesClient().NewListByVirtualNetworkGatewayPager("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.ListVirtualNetworkGatewayNatRulesResult = armnetwork.ListVirtualNetworkGatewayNatRulesResult{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go index 2238f9338f28..4cb5bf9b30f5 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to create or update virtual network gateway operation. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *VirtualNetworkGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -117,7 +114,7 @@ func (client *VirtualNetworkGatewaysClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +126,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginDelete @@ -155,7 +152,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginDelete" @@ -178,7 +175,7 @@ func (client *VirtualNetworkGatewaysClient) deleteOperation(ctx context.Context, } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -197,7 +194,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +204,7 @@ func (client *VirtualNetworkGatewaysClient) deleteCreateRequest(ctx context.Cont // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - request - The parameters are supplied to disconnect vpn connections. @@ -235,7 +232,7 @@ func (client *VirtualNetworkGatewaysClient) BeginDisconnectVirtualNetworkGateway // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -258,7 +255,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo } // disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest creates the DisconnectVirtualNetworkGatewayVPNConnections request. -func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, options *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*policy.Request, error) { +func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVPNConnectionRequest, _ *VirtualNetworkGatewaysClientBeginDisconnectVirtualNetworkGatewayVPNConnectionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -277,7 +274,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { @@ -290,7 +287,7 @@ func (client *VirtualNetworkGatewaysClient) disconnectVirtualNetworkGatewayVPNCo // group. Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. @@ -318,7 +315,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGenerateVPNProfile(ctx context. // Used for IKEV2 and radius based authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -341,7 +338,7 @@ 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, options *VirtualNetworkGatewaysClientBeginGenerateVPNProfileOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -360,7 +357,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -373,7 +370,7 @@ func (client *VirtualNetworkGatewaysClient) generateVPNProfileCreateRequest(ctx // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to the generate virtual network gateway VPN client package operation. @@ -401,7 +398,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGeneratevpnclientpackage(ctx co // resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -424,7 +421,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackage(ctx context } // generatevpnclientpackageCreateRequest creates the Generatevpnclientpackage request. -func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VPNClientParameters, options *VirtualNetworkGatewaysClientBeginGeneratevpnclientpackageOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -443,7 +440,7 @@ func (client *VirtualNetworkGatewaysClient) generatevpnclientpackageCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -455,7 +452,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientGetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.Get @@ -483,7 +480,7 @@ func (client *VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGro } // getCreateRequest creates the Get request. -func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -502,7 +499,7 @@ func (client *VirtualNetworkGatewaysClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,7 +518,7 @@ func (client *VirtualNetworkGatewaysClient) getHandleResponse(resp *http.Respons // specified peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peer - The IP address of the peer. @@ -549,7 +546,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetAdvertisedRoutes(ctx context // peer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -572,7 +569,7 @@ 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, options *VirtualNetworkGatewaysClientBeginGetAdvertisedRoutesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -591,7 +588,7 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("peer", peer) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -601,7 +598,7 @@ func (client *VirtualNetworkGatewaysClient) getAdvertisedRoutesCreateRequest(ctx // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus @@ -627,7 +624,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetBgpPeerStatus" @@ -669,7 +666,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.Peer != nil { reqQP.Set("peer", *options.Peer) } @@ -682,7 +679,7 @@ func (client *VirtualNetworkGatewaysClient) getBgpPeerStatusCreateRequest(ctx co // for different peering locations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - typeParam - The type of failover test @@ -711,7 +708,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverAllTestDetails(ctx c // different peering locations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -734,7 +731,7 @@ 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, options *VirtualNetworkGatewaysClientBeginGetFailoverAllTestDetailsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -753,7 +750,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("fetchLatest", strconv.FormatBool(fetchLatest)) reqQP.Set("type", typeParam) req.Raw().URL.RawQuery = reqQP.Encode() @@ -765,7 +762,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverAllTestDetailsCreateReque // gateway based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test @@ -794,7 +791,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetFailoverSingleTestDetails(ct // based on the test Guid // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -817,7 +814,7 @@ 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, options *VirtualNetworkGatewaysClientBeginGetFailoverSingleTestDetailsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -836,7 +833,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("failoverTestId", failoverTestID) reqQP.Set("peeringLocation", peeringLocation) req.Raw().URL.RawQuery = reqQP.Encode() @@ -848,7 +845,7 @@ func (client *VirtualNetworkGatewaysClient) getFailoverSingleTestDetailsCreateRe // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetLearnedRoutes @@ -875,7 +872,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetLearnedRoutes(ctx context.Co // learned from BGP peers. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetLearnedRoutes" @@ -898,7 +895,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutes(ctx context.Context } // getLearnedRoutesCreateRequest creates the GetLearnedRoutes request. -func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetLearnedRoutesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -917,7 +914,170 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetResiliencyInformation +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetResiliencyInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetResiliencyInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getResiliencyInformation(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetResiliencyInformationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientGetResiliencyInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-07-01 +func (client *VirtualNetworkGatewaysClient) getResiliencyInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetResiliencyInformationOptions) (*http.Response, error) { + var err error + const operationName = "VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName, 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 *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 resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + 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", "2024-07-01") + if options != nil && options.AttemptRefresh != nil { + reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 2024-07-01 +// - resourceGroupName - The name of the resource group. +// - virtualNetworkGatewayName - The name of the virtual network gateway. +// - options - VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetRoutesInformation +// method. +func (client *VirtualNetworkGatewaysClient) BeginGetRoutesInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientGetRoutesInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.getRoutesInformation(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientGetRoutesInformationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientGetRoutesInformationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-07-01 +func (client *VirtualNetworkGatewaysClient) getRoutesInformation(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetRoutesInformationOptions) (*http.Response, error) { + var err error + const operationName = "VirtualNetworkGatewaysClient.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, virtualNetworkGatewayName, 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 *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 resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if virtualNetworkGatewayName == "" { + 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", "2024-07-01") + if options != nil && options.AttemptRefresh != nil { + reqQP.Set("attemptRefresh", strconv.FormatBool(*options.AttemptRefresh)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -927,7 +1087,7 @@ func (client *VirtualNetworkGatewaysClient) getLearnedRoutesCreateRequest(ctx co // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL @@ -954,7 +1114,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVPNProfilePackageURL(ctx con // 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVPNProfilePackageURL" @@ -977,7 +1137,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURL(ctx context. } // getVPNProfilePackageURLCreateRequest creates the GetVPNProfilePackageURL request. -func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVPNProfilePackageURLOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -996,7 +1156,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1006,7 +1166,7 @@ func (client *VirtualNetworkGatewaysClient) getVPNProfilePackageURLCreateRequest // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions contains the optional parameters for the @@ -1033,7 +1193,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientConnectionHealth(ct // gateway in the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientConnectionHealth" @@ -1056,7 +1216,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealth(ctx con } // getVpnclientConnectionHealthCreateRequest creates the GetVpnclientConnectionHealth request. -func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientConnectionHealthOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1075,7 +1235,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1086,7 +1246,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientConnectionHealthCreateRe // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The virtual network gateway name. // - options - VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions contains the optional parameters for the @@ -1114,7 +1274,7 @@ func (client *VirtualNetworkGatewaysClient) BeginGetVpnclientIPSecParameters(ctx // provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginGetVpnclientIPSecParameters" @@ -1137,7 +1297,7 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParameters(ctx cont } // getVpnclientIPSecParametersCreateRequest creates the GetVpnclientIPSecParameters request. -func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginGetVpnclientIPSecParametersOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1156,15 +1316,327 @@ func (client *VirtualNetworkGatewaysClient) getVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginInvokeAbortMigration - Trigger abort migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The resource group name of the virtual network gateway. +// - virtualNetworkGatewayName - The name of the 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.invokeAbortMigration(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientInvokeAbortMigrationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// InvokeAbortMigration - Trigger abort migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *VirtualNetworkGatewaysClient) invokeAbortMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (*http.Response, error) { + var err error + const operationName = "VirtualNetworkGatewaysClient.BeginInvokeAbortMigration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.invokeAbortMigrationCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// invokeAbortMigrationCreateRequest creates the InvokeAbortMigration request. +func (client *VirtualNetworkGatewaysClient) invokeAbortMigrationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginInvokeAbortMigrationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/abortMigration" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginInvokeCommitMigration - Trigger commit migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The resource group name of the virtual network gateway. +// - virtualNetworkGatewayName - The name of the 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.invokeCommitMigration(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientInvokeCommitMigrationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// InvokeCommitMigration - Trigger commit migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *VirtualNetworkGatewaysClient) invokeCommitMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (*http.Response, error) { + var err error + const operationName = "VirtualNetworkGatewaysClient.BeginInvokeCommitMigration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.invokeCommitMigrationCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// invokeCommitMigrationCreateRequest creates the InvokeCommitMigration request. +func (client *VirtualNetworkGatewaysClient) invokeCommitMigrationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginInvokeCommitMigrationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/commitMigration" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginInvokeExecuteMigration - Trigger execute migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The resource group name of the virtual network gateway. +// - virtualNetworkGatewayName - The name of the 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) { + if options == nil || options.ResumeToken == "" { + resp, err := client.invokeExecuteMigration(ctx, resourceGroupName, virtualNetworkGatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientInvokeExecuteMigrationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// InvokeExecuteMigration - Trigger execute migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +func (client *VirtualNetworkGatewaysClient) invokeExecuteMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (*http.Response, error) { + var err error + const operationName = "VirtualNetworkGatewaysClient.BeginInvokeExecuteMigration" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.invokeExecuteMigrationCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// invokeExecuteMigrationCreateRequest creates the InvokeExecuteMigration request. +func (client *VirtualNetworkGatewaysClient) invokeExecuteMigrationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, _ *VirtualNetworkGatewaysClientBeginInvokeExecuteMigrationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/executeMigration" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginInvokePrepareMigration - Trigger prepare migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-01 +// - resourceGroupName - The resource group name of the virtual network gateway. +// - virtualNetworkGatewayName - The name of the 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. +func (client *VirtualNetworkGatewaysClient) BeginInvokePrepareMigration(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, migrationParams VirtualNetworkGatewayMigrationParameters, options *VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (*runtime.Poller[VirtualNetworkGatewaysClientInvokePrepareMigrationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.invokePrepareMigration(ctx, resourceGroupName, virtualNetworkGatewayName, migrationParams, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualNetworkGatewaysClientInvokePrepareMigrationResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// InvokePrepareMigration - Trigger prepare migration for the basic virtual network gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-07-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" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.invokePrepareMigrationCreateRequest(ctx, resourceGroupName, virtualNetworkGatewayName, migrationParams, 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) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// invokePrepareMigrationCreateRequest creates the InvokePrepareMigration request. +func (client *VirtualNetworkGatewaysClient) invokePrepareMigrationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, migrationParams VirtualNetworkGatewayMigrationParameters, _ *VirtualNetworkGatewaysClientBeginInvokePrepareMigrationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/prepareMigration" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.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 virtualNetworkGatewayName == "" { + return nil, errors.New("parameter virtualNetworkGatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{virtualNetworkGatewayName}", url.PathEscape(virtualNetworkGatewayName)) + 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", "2024-07-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, migrationParams); err != nil { + return nil, err + } + return req, nil +} + // NewListPager - Gets all virtual network gateways by resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkGatewaysClientListOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListPager // method. @@ -1192,7 +1664,7 @@ func (client *VirtualNetworkGatewaysClient) NewListPager(resourceGroupName strin } // listCreateRequest creates the List request. -func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkGatewaysClientListOptions) (*policy.Request, error) { +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") @@ -1207,7 +1679,7 @@ func (client *VirtualNetworkGatewaysClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1224,7 +1696,7 @@ func (client *VirtualNetworkGatewaysClient) listHandleResponse(resp *http.Respon // NewListConnectionsPager - Gets all the connections in a virtual network gateway. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientListConnectionsOptions contains the optional parameters for the VirtualNetworkGatewaysClient.NewListConnectionsPager @@ -1253,7 +1725,7 @@ func (client *VirtualNetworkGatewaysClient) NewListConnectionsPager(resourceGrou } // listConnectionsCreateRequest creates the ListConnections request. -func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientListConnectionsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1272,7 +1744,7 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1290,7 +1762,7 @@ func (client *VirtualNetworkGatewaysClient) listConnectionsHandleResponse(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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginReset @@ -1316,7 +1788,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginReset" @@ -1358,7 +1830,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.GatewayVip != nil { reqQP.Set("gatewayVip", *options.GatewayVip) } @@ -1371,7 +1843,7 @@ func (client *VirtualNetworkGatewaysClient) resetCreateRequest(ctx context.Conte // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey @@ -1397,7 +1869,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginResetVPNClientSharedKey" @@ -1420,7 +1892,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKey(ctx context. } // resetVPNClientSharedKeyCreateRequest creates the ResetVPNClientSharedKey request. -func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginResetVPNClientSharedKeyOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1439,7 +1911,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1449,7 +1921,7 @@ func (client *VirtualNetworkGatewaysClient) resetVPNClientSharedKeyCreateRequest // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - vpnclientIPSecParams - Parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S client @@ -1478,7 +1950,7 @@ func (client *VirtualNetworkGatewaysClient) BeginSetVpnclientIPSecParameters(ctx // 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1501,7 +1973,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParameters(ctx cont } // setVpnclientIPSecParametersCreateRequest creates the SetVpnclientIPSecParameters request. -func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIPSecParams VPNClientIPsecParameters, options *VirtualNetworkGatewaysClientBeginSetVpnclientIPSecParametersOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1520,7 +1992,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnclientIPSecParams); err != nil { @@ -1533,7 +2005,7 @@ func (client *VirtualNetworkGatewaysClient) setVpnclientIPSecParametersCreateReq // peering location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - peeringLocation - Peering location of the test @@ -1561,7 +2033,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStartExpressRouteSiteFailoverSi // location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -1584,7 +2056,7 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat } // startExpressRouteSiteFailoverSimulationCreateRequest creates the StartExpressRouteSiteFailoverSimulation request. -func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peeringLocation string, options *VirtualNetworkGatewaysClientBeginStartExpressRouteSiteFailoverSimulationOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1603,7 +2075,7 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("peeringLocation", peeringLocation) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -1613,7 +2085,7 @@ func (client *VirtualNetworkGatewaysClient) startExpressRouteSiteFailoverSimulat // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VirtualNetworkGatewaysClient.BeginStartPacketCapture @@ -1639,7 +2111,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkGatewaysClient.BeginStartPacketCapture" @@ -1681,7 +2153,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -1697,7 +2169,7 @@ func (client *VirtualNetworkGatewaysClient) startPacketCaptureCreateRequest(ctx // peering location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - stopParameters - Virtual network gateway stop simulation parameters supplied to stop failover simulation on gateway. @@ -1725,7 +2197,7 @@ func (client *VirtualNetworkGatewaysClient) BeginStopExpressRouteSiteFailoverSim // location // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -1748,7 +2220,7 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati } // stopExpressRouteSiteFailoverSimulationCreateRequest creates the StopExpressRouteSiteFailoverSimulation request. -func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulationCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, stopParameters ExpressRouteFailoverStopAPIParameters, options *VirtualNetworkGatewaysClientBeginStopExpressRouteSiteFailoverSimulationOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1767,7 +2239,7 @@ func (client *VirtualNetworkGatewaysClient) stopExpressRouteSiteFailoverSimulati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, stopParameters); err != nil { @@ -1779,7 +2251,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Virtual network gateway packet capture parameters supplied to stop packet capture on gateway. @@ -1806,7 +2278,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1829,7 +2301,7 @@ 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, options *VirtualNetworkGatewaysClientBeginStopPacketCaptureOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1848,7 +2320,7 @@ func (client *VirtualNetworkGatewaysClient) stopPacketCaptureCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1860,7 +2332,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - options - VirtualNetworkGatewaysClientSupportedVPNDevicesOptions contains the optional parameters for the VirtualNetworkGatewaysClient.SupportedVPNDevices @@ -1888,7 +2360,7 @@ func (client *VirtualNetworkGatewaysClient) SupportedVPNDevices(ctx context.Cont } // supportedVPNDevicesCreateRequest creates the SupportedVPNDevices request. -func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, options *VirtualNetworkGatewaysClientSupportedVPNDevicesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1907,7 +2379,7 @@ func (client *VirtualNetworkGatewaysClient) supportedVPNDevicesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1925,7 +2397,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayName - The name of the virtual network gateway. // - parameters - Parameters supplied to update virtual network gateway tags. @@ -1952,7 +2424,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1975,7 +2447,7 @@ 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, options *VirtualNetworkGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1994,7 +2466,7 @@ func (client *VirtualNetworkGatewaysClient) updateTagsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2006,7 +2478,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkGatewayConnectionName - The name of the virtual network gateway connection for which the configuration script // is generated. @@ -2036,7 +2508,7 @@ func (client *VirtualNetworkGatewaysClient) VPNDeviceConfigurationScript(ctx con } // vpnDeviceConfigurationScriptCreateRequest creates the VPNDeviceConfigurationScript request. -func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VPNDeviceScriptParameters, options *VirtualNetworkGatewaysClientVPNDeviceConfigurationScriptOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -2055,7 +2527,7 @@ func (client *VirtualNetworkGatewaysClient) vpnDeviceConfigurationScriptCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go deleted file mode 100644 index 496e6643cf2f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkgateways_client_example_test.go +++ /dev/null @@ -1,1703 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - 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"), - 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), - GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - { - Name: to.Ptr("gwipconfig1"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodDynamic), - 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{ - { - 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), - }, - }, - { - 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), - }, - }}, - SKU: &armnetwork.VirtualNetworkGatewaySKU{ - Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameVPNGw1), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierVPNGw1), - }, - VPNClientConfiguration: &armnetwork.VPNClientConfiguration{ - RadiusServers: []*armnetwork.RadiusServer{ - { - RadiusServerAddress: to.Ptr("10.2.0.0"), - RadiusServerScore: to.Ptr[int64](20), - RadiusServerSecret: to.Ptr("radiusServerSecret"), - }}, - VPNClientProtocols: []*armnetwork.VPNClientProtocol{ - to.Ptr(armnetwork.VPNClientProtocolOpenVPN)}, - VPNClientRevokedCertificates: []*armnetwork.VPNClientRevokedCertificate{}, - VPNClientRootCertificates: []*armnetwork.VPNClientRootCertificate{}, - }, - VPNType: to.Ptr(armnetwork.VPNTypeRouteBased), - }, - }, nil) - if 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.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), - // 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), - // }, - // 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), - // GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeVPN), - // InboundDNSForwardingEndpoint: to.Ptr("10.0.1.14"), - // 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{ - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginCreateOrUpdate(ctx, "rg1", "ergw", armnetwork.VirtualNetworkGateway{ - Location: to.Ptr("centralus"), - Properties: &armnetwork.VirtualNetworkGatewayPropertiesFormat{ - Active: to.Ptr(false), - AllowRemoteVnetTraffic: to.Ptr(false), - AllowVirtualWanTraffic: to.Ptr(false), - DisableIPSecReplayProtection: to.Ptr(false), - EnableBgp: to.Ptr(false), - EnableBgpRouteTranslationForNat: to.Ptr(false), - GatewayType: to.Ptr(armnetwork.VirtualNetworkGatewayTypeExpressRoute), - IPConfigurations: []*armnetwork.VirtualNetworkGatewayIPConfiguration{ - { - Name: to.Ptr("gwipconfig1"), - Properties: &armnetwork.VirtualNetworkGatewayIPConfigurationPropertiesFormat{ - PrivateIPAllocationMethod: to.Ptr(armnetwork.IPAllocationMethodStatic), - 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{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/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), - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/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), - }, - }}, - SKU: &armnetwork.VirtualNetworkGatewaySKU{ - Name: to.Ptr(armnetwork.VirtualNetworkGatewaySKUNameErGwScale), - Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - }, - VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - }, - }, nil) - if 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.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), - // 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"), - // }, - // }, - // }}, - // NatRules: []*armnetwork.VirtualNetworkGatewayNatRule{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/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), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/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.VirtualNetworkGatewaySKUNameErGwScale), - // Capacity: to.Ptr[int32](0), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().Get(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.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), - // 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), - // }, - // 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/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{ - // { - // 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), - // }, - // }, - // { - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().Get(ctx, "rg1", "ergw", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // 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), - // EnablePrivateIPAddress: 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.IPAllocationMethodStatic), - // 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{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/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/ergw/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.VirtualNetworkGatewaySKUNameErGwScale), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr(armnetwork.VirtualNetworkGatewaySKUTierErGwScale), - // }, - // VPNGatewayGeneration: to.Ptr(armnetwork.VPNGatewayGenerationNone), - // VPNType: to.Ptr(armnetwork.VPNTypePolicyBased), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - } - _, 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // }, - // 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), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginResetOptions{GatewayVip: nil}) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginResetVPNClientSharedKey(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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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 = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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 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 = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetVPNProfilePackageURL(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.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetBgpPeerStatus(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginGetBgpPeerStatusOptions{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.BgpPeerStatusListResult = armnetwork.BgpPeerStatusListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworkGatewaysClient().SupportedVPNDevices(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.Value = "" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetLearnedRoutes(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.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetAdvertisedRoutes(ctx, "rg1", "vpngw", "test", nil) - if 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.GatewayRouteListResult = armnetwork.GatewayRouteListResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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 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), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}]}"), - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VirtualNetworkGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginGetFailoverAllTestDetails(ctx, "rg1", "ergw", "SingleSiteFailover", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.ExpressRouteFailoverSingleTestDetailsArray = []*armnetwork.ExpressRouteFailoverSingleTestDetails{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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]" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkGatewaysClient().BeginStopExpressRouteSiteFailoverSimulation(ctx, "rg1", "ergw", armnetwork.ExpressRouteFailoverStopAPIParameters{ - PeeringLocation: to.Ptr("Vancouver"), - WasSimulationSuccessful: to.Ptr(true), - Details: []*armnetwork.FailoverConnectionDetails{ - { - FailoverConnectionName: to.Ptr("conn1"), - FailoverLocation: to.Ptr("Denver"), - IsVerified: to.Ptr(false), - }, - { - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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]" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go index 0e4b2016cf00..56f9da2de97c 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the peering. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -121,7 +118,7 @@ func (client *VirtualNetworkPeeringsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.SyncRemoteAddressSpace != nil { reqQP.Set("syncRemoteAddressSpace", string(*options.SyncRemoteAddressSpace)) } @@ -136,7 +133,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -163,7 +160,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -186,7 +183,7 @@ 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, options *VirtualNetworkPeeringsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -209,7 +206,7 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +215,7 @@ func (client *VirtualNetworkPeeringsClient) deleteCreateRequest(ctx context.Cont // Get - Gets the specified virtual network peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - virtualNetworkPeeringName - The name of the virtual network peering. @@ -247,7 +244,7 @@ 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, options *VirtualNetworkPeeringsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -270,7 +267,7 @@ func (client *VirtualNetworkPeeringsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +284,7 @@ func (client *VirtualNetworkPeeringsClient) getHandleResponse(resp *http.Respons // NewListPager - Gets all virtual network peerings in a virtual network. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworkPeeringsClientListOptions contains the optional parameters for the VirtualNetworkPeeringsClient.NewListPager @@ -316,7 +313,7 @@ func (client *VirtualNetworkPeeringsClient) NewListPager(resourceGroupName strin } // listCreateRequest creates the List request. -func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworkPeeringsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -335,7 +332,7 @@ func (client *VirtualNetworkPeeringsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a4950e4ed080..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworkpeerings_client_example_test.go +++ /dev/null @@ -1,950 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // 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"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VirtualNetworkSubnetPeeringGet.json -func ExampleVirtualNetworkPeeringsClient_Get_getSubnetPeering() { - cred, err := 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - 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"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) - if 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(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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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: nil}) - if 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), - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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: nil}) - if 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), - // 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"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - 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"), - }, - UseRemoteGateways: to.Ptr(false), - }, - }, &armnetwork.VirtualNetworkPeeringsClientBeginCreateOrUpdateOptions{SyncRemoteAddressSpace: nil}) - if 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("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("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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - if 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), - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - if 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(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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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)}) - if 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")}, - // }, - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkPeeringsClient().NewListPager("peerTest", "vnet1", 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.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")}, - // }, - // 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"), - // }, - // RemoteVirtualNetworkAddressSpace: &armnetwork.AddressSpace{ - // AddressPrefixes: []*string{ - // to.Ptr("12.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkPeeringsClient().NewListPager("peerTest", "vnet1", 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.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")}, - // }, - // 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"), - // }, - // RemoteVirtualNetworkEncryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // 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), - // 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), - // }, - // UseRemoteGateways: to.Ptr(false), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go index 57152d4a1bf1..ac8d6bb3ed51 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - ipAddress - The private IP address to be verified. @@ -77,7 +74,7 @@ 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, options *VirtualNetworksClientCheckIPAddressAvailabilityOptions) (*policy.Request, error) { +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" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +93,7 @@ func (client *VirtualNetworksClient) checkIPAddressAvailabilityCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") reqQP.Set("ipAddress", ipAddress) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -115,7 +112,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to the create or update virtual network operation. @@ -142,7 +139,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -165,7 +162,7 @@ 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, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -184,7 +181,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -196,7 +193,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete @@ -222,7 +219,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -245,7 +242,7 @@ func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -264,7 +261,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +270,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the specified virtual network by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. @@ -322,7 +319,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +336,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListPager - Gets all virtual networks in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworksClientListOptions contains the optional parameters for the VirtualNetworksClient.NewListPager // method. @@ -367,7 +364,7 @@ func (client *VirtualNetworksClient) NewListPager(resourceGroupName string, opti } // listCreateRequest creates the List request. -func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworksClientListOptions) (*policy.Request, error) { +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") @@ -382,7 +379,7 @@ func (client *VirtualNetworksClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -399,7 +396,7 @@ func (client *VirtualNetworksClient) listHandleResponse(resp *http.Response) (Vi // NewListAllPager - Gets all virtual networks in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualNetworksClientListAllOptions contains the optional parameters for the VirtualNetworksClient.NewListAllPager // method. func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksClientListAllOptions) *runtime.Pager[VirtualNetworksClientListAllResponse] { @@ -426,7 +423,7 @@ func (client *VirtualNetworksClient) NewListAllPager(options *VirtualNetworksCli } // listAllCreateRequest creates the ListAll request. -func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworksClientListAllOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, _ *VirtualNetworksClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -437,7 +434,7 @@ func (client *VirtualNetworksClient) listAllCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,7 +451,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientBeginListDdosProtectionStatusOptions contains the optional parameters for the VirtualNetworksClient.BeginListDdosProtectionStatus @@ -497,7 +494,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworksClient) listDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginListDdosProtectionStatusOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginListDdosProtectionStatus" @@ -539,7 +536,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.SkipToken != nil { reqQP.Set("skipToken", *options.SkipToken) } @@ -562,7 +559,7 @@ func (client *VirtualNetworksClient) listDdosProtectionStatusHandleResponse(resp // NewListUsagePager - Lists usage stats. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - options - VirtualNetworksClientListUsageOptions contains the optional parameters for the VirtualNetworksClient.NewListUsagePager @@ -591,7 +588,7 @@ func (client *VirtualNetworksClient) NewListUsagePager(resourceGroupName string, } // listUsageCreateRequest creates the ListUsage request. -func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientListUsageOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -610,7 +607,7 @@ func (client *VirtualNetworksClient) listUsageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -628,7 +625,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualNetworkName - The name of the virtual network. // - parameters - Parameters supplied to update virtual network tags. @@ -657,7 +654,7 @@ 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, options *VirtualNetworksClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -676,7 +673,7 @@ func (client *VirtualNetworksClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go deleted file mode 100644 index 5c3238b04b8b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,1209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rg1", "test-vnet", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{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.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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{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.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")}, - // }, - // 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"), - // 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"), - // }, - // }}, - // 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(""), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientGetOptions{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.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")}, - // }, - // 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\""), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.214.0/24"), - // Delegations: []*armnetwork.Delegation{ - // { - // 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{ - // }, - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - 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 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")}, - // }, - // FlowTimeoutInMinutes: to.Ptr[int32](10), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - BgpCommunities: &armnetwork.VirtualNetworkBgpCommunities{ - VirtualNetworkCommunity: to.Ptr("12076:20000"), - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) - if 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")}, - // }, - // 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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("westcentralus"), - 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"), - Delegations: []*armnetwork.Delegation{ - { - Name: to.Ptr("myDelegation"), - Properties: &armnetwork.ServiceDelegationPropertiesFormat{ - 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 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("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"), - // 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - Encryption: &armnetwork.VirtualNetworkEncryption{ - Enabled: to.Ptr(true), - Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - }, - Subnets: []*armnetwork.Subnet{ - { - Name: to.Ptr("test-1"), - Properties: &armnetwork.SubnetPropertiesFormat{ - AddressPrefix: to.Ptr("10.0.0.0/24"), - }, - }}, - }, - }, nil) - if 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")}, - // }, - // Encryption: &armnetwork.VirtualNetworkEncryption{ - // Enabled: to.Ptr(true), - // Enforcement: to.Ptr(armnetwork.VirtualNetworkEncryptionEnforcementAllowUnencrypted), - // }, - // 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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{ - IpamPoolPrefixAllocations: []*armnetwork.IpamPoolPrefixAllocation{ - { - NumberOfIPAddresses: to.Ptr("65536"), - Pool: &armnetwork.IpamPoolPrefixAllocationPool{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/nm1/ipamPools/testIpamPool"), - }, - }}, - }, - 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"), - }, - }}, - }, - }}, - }, - }, nil) - if 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("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"), - // }, - // }}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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 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("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")}, - // }, - // 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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("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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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")}, - // }, - // 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"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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")}, - // }, - // 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"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // Subnets: []*armnetwork.Subnet{ - // }, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().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.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")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // }, - // }, - // 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"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }, - // { - // Name: to.Ptr("vnet2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().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.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")}, - // }, - // DhcpOptions: &armnetwork.DhcpOptions{ - // DNSServers: []*string{ - // }, - // }, - // 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"), - // Properties: &armnetwork.SubnetPropertiesFormat{ - // AddressPrefix: to.Ptr("10.0.0.0/24"), - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // VirtualNetworkPeerings: []*armnetwork.VirtualNetworkPeering{ - // }, - // }, - // }, - // { - // Name: to.Ptr("vnet2"), - // Type: to.Ptr("Microsoft.Network/virtualNetworks"), - // ID: to.Ptr("/subscriptions/subid/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")}, - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListUsagePager("rg1", "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.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/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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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, - }) - if 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"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go index 744f363a084e..74265960d37d 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewVirtualNetworkTapsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates or updates a Virtual Network Tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the virtual network tap. // - parameters - Parameters supplied to the create or update virtual network tap operation. @@ -74,7 +71,7 @@ func (client *VirtualNetworkTapsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a Virtual Network Tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *VirtualNetworkTapsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,7 @@ func (client *VirtualNetworkTapsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the virtual network tap. // - options - VirtualNetworkTapsClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkTapsClient.BeginDelete @@ -154,7 +151,7 @@ func (client *VirtualNetworkTapsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworkTapsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *VirtualNetworkTapsClient) deleteOperation(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *VirtualNetworkTapsClient) deleteCreateRequest(ctx context.Context, // Get - Gets information about the specified virtual network tap. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of virtual network tap. // - options - VirtualNetworkTapsClientGetOptions contains the optional parameters for the VirtualNetworkTapsClient.Get method. @@ -232,7 +229,7 @@ func (client *VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, resourceGroupName string, tapName string, options *VirtualNetworkTapsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -251,7 +248,7 @@ func (client *VirtualNetworkTapsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +265,7 @@ func (client *VirtualNetworkTapsClient) getHandleResponse(resp *http.Response) ( // NewListAllPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VirtualNetworkTapsClientListAllOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListAllPager // method. func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkTapsClientListAllOptions) *runtime.Pager[VirtualNetworkTapsClientListAllResponse] { @@ -295,7 +292,7 @@ func (client *VirtualNetworkTapsClient) NewListAllPager(options *VirtualNetworkT } // listAllCreateRequest creates the ListAll request. -func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context, options *VirtualNetworkTapsClientListAllOptions) (*policy.Request, error) { +func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context, _ *VirtualNetworkTapsClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -306,7 +303,7 @@ func (client *VirtualNetworkTapsClient) listAllCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +320,7 @@ func (client *VirtualNetworkTapsClient) listAllHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Gets all the VirtualNetworkTaps in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualNetworkTapsClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworkTapsClient.NewListByResourceGroupPager // method. @@ -351,7 +348,7 @@ func (client *VirtualNetworkTapsClient) NewListByResourceGroupPager(resourceGrou } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworkTapsClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -366,7 +363,7 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +381,7 @@ func (client *VirtualNetworkTapsClient) listByResourceGroupHandleResponse(resp * // UpdateTags - Updates an VirtualNetworkTap tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - tapName - The name of the tap. // - tapParameters - Parameters supplied to update VirtualNetworkTap tags. @@ -413,7 +410,7 @@ 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, options *VirtualNetworkTapsClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -432,7 +429,7 @@ func (client *VirtualNetworkTapsClient) updateTagsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tapParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go deleted file mode 100644 index 3245c6e210e1..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualnetworktaps_client_example_test.go +++ /dev/null @@ -1,307 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworkTapsClient().BeginDelete(ctx, "rg1", "test-vtap", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkTapsClient().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.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"), - // }, - // 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"), - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworkTapsClient().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.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"), - // }, - // 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"), - // }, - // 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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go index 70a28996a3f4..bf69e8adb6c1 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -75,7 +72,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -98,7 +95,7 @@ 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, options *VirtualRouterPeeringsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +118,7 @@ func (client *VirtualRouterPeeringsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -133,7 +130,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the peering. @@ -160,7 +157,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -183,7 +180,7 @@ 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, options *VirtualRouterPeeringsClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -206,7 +203,7 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *VirtualRouterPeeringsClient) deleteCreateRequest(ctx context.Conte // Get - Gets the specified Virtual Router Peering. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - peeringName - The name of the Virtual Router Peering. @@ -244,7 +241,7 @@ 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, options *VirtualRouterPeeringsClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -267,7 +264,7 @@ func (client *VirtualRouterPeeringsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,7 @@ func (client *VirtualRouterPeeringsClient) getHandleResponse(resp *http.Response // NewListPager - Lists all Virtual Router Peerings in a Virtual Router resource. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRouterPeeringsClientListOptions contains the optional parameters for the VirtualRouterPeeringsClient.NewListPager @@ -313,7 +310,7 @@ func (client *VirtualRouterPeeringsClient) NewListPager(resourceGroupName string } // listCreateRequest creates the List request. -func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRouterPeeringsClientListOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +329,7 @@ func (client *VirtualRouterPeeringsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7447ab69e651..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualrouterpeerings_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRouterPeeringsClient().BeginDelete(ctx, "rg1", "virtualRouter", "peering1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualRouterPeeringsClient().Get(ctx, "rg1", "virtualRouter", "peering1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRouterPeeringsClient().NewListPager("rg1", "virtualRouter", 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.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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go index 2535e97af938..de2e7a4c8dc5 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualrouters_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - parameters - Parameters supplied to the create or update Virtual Router. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ 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, options *VirtualRoutersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,7 +113,7 @@ func (client *VirtualRoutersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientBeginDeleteOptions contains the optional parameters for the VirtualRoutersClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualRoutersClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *VirtualRoutersClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualRouterName string, options *VirtualRoutersClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -196,7 +193,7 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *VirtualRoutersClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the specified Virtual Router. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - virtualRouterName - The name of the Virtual Router. // - options - VirtualRoutersClientGetOptions contains the optional parameters for the VirtualRoutersClient.Get method. @@ -254,7 +251,7 @@ func (client *VirtualRoutersClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *VirtualRoutersClient) getHandleResponse(resp *http.Response) (Virt // NewListPager - Gets all the Virtual Routers in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -297,7 +294,7 @@ func (client *VirtualRoutersClient) NewListPager(options *VirtualRoutersClientLi } // listCreateRequest creates the List request. -func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, options *VirtualRoutersClientListOptions) (*policy.Request, error) { +func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, _ *VirtualRoutersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -308,7 +305,7 @@ func (client *VirtualRoutersClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +322,7 @@ func (client *VirtualRoutersClient) listHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - Lists all Virtual Routers in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - VirtualRoutersClientListByResourceGroupOptions contains the optional parameters for the VirtualRoutersClient.NewListByResourceGroupPager // method. @@ -353,7 +350,7 @@ func (client *VirtualRoutersClient) NewListByResourceGroupPager(resourceGroupNam } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualRoutersClientListByResourceGroupOptions) (*policy.Request, error) { +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") @@ -368,7 +365,7 @@ func (client *VirtualRoutersClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 6a2a1be57b2f..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualrouters_client_example_test.go +++ /dev/null @@ -1,246 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualRoutersClient().BeginDelete(ctx, "rg1", "virtualRouter", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualRoutersClient().Get(ctx, "rg1", "virtualRouter", &armnetwork.VirtualRoutersClientGetOptions{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.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")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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"), - // }, - // 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")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRoutersClient().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.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"), - // }, - // 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")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualRoutersClient().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.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"), - // }, - // 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")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go index 9006c95546ee..8790ae3355f6 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwan_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go index 29ea1f776142..5cc7a3dc1931 100644 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client.go +++ b/sdk/resourcemanager/network/armnetwork/virtualwans_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being created or updated. // - wanParameters - Parameters supplied to create or update VirtualWAN. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VirtualWansClient) createOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, options *VirtualWansClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters VirtualWAN, _ *VirtualWansClientBeginCreateOrUpdateOptions) (*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") @@ -116,7 +113,7 @@ func (client *VirtualWansClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being deleted. // - options - VirtualWansClientBeginDeleteOptions contains the optional parameters for the VirtualWansClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualWansClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *VirtualWansClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VirtualWansClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, _ *VirtualWansClientBeginDeleteOptions) (*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") @@ -195,7 +192,7 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *VirtualWansClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a VirtualWAN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being retrieved. // - options - VirtualWansClientGetOptions contains the optional parameters for the VirtualWansClient.Get method. @@ -231,7 +228,7 @@ 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, options *VirtualWansClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -250,7 +247,7 @@ func (client *VirtualWansClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +264,7 @@ func (client *VirtualWansClient) getHandleResponse(resp *http.Response) (Virtual // NewListPager - Lists all the VirtualWANs in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -293,7 +290,7 @@ func (client *VirtualWansClient) NewListPager(options *VirtualWansClientListOpti } // listCreateRequest creates the List request. -func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options *VirtualWansClientListOptions) (*policy.Request, error) { +func (client *VirtualWansClient) listCreateRequest(ctx context.Context, _ *VirtualWansClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -304,7 +301,7 @@ func (client *VirtualWansClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +318,7 @@ func (client *VirtualWansClient) listHandleResponse(resp *http.Response) (Virtua // NewListByResourceGroupPager - Lists all the VirtualWANs in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - options - VirtualWansClientListByResourceGroupOptions contains the optional parameters for the VirtualWansClient.NewListByResourceGroupPager // method. @@ -349,7 +346,7 @@ func (client *VirtualWansClient) NewListByResourceGroupPager(resourceGroupName s } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualWansClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualWansClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -364,7 +361,7 @@ func (client *VirtualWansClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +379,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VirtualWan. // - virtualWANName - The name of the VirtualWAN being updated. // - wanParameters - Parameters supplied to Update VirtualWAN tags. @@ -410,7 +407,7 @@ func (client *VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupNa } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, options *VirtualWansClientUpdateTagsOptions) (*policy.Request, error) { +func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, wanParameters TagsObject, _ *VirtualWansClientUpdateTagsOptions) (*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") @@ -429,7 +426,7 @@ func (client *VirtualWansClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, wanParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go b/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go deleted file mode 100644 index 5942f9c9bdce..000000000000 --- a/sdk/resourcemanager/network/armnetwork/virtualwans_client_example_test.go +++ /dev/null @@ -1,374 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - }, - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // { - // }, - // { - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualWansClient().BeginDelete(ctx, "rg1", "virtualWan1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualWansClient().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.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"), - // }, - // { - // 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"), - // }}, - // }, - // }, - // { - // 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"), - // }, - // 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"), - // }, - // { - // 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"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite4"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualWansClient().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.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"), - // }, - // { - // 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"), - // }}, - // }, - // }, - // { - // 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"), - // }, - // 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"), - // }, - // { - // 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"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/vpnSites/vpnSite2"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go index dd743c926d26..7432f17efec4 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewVPNConnectionsClient(subscriptionID string, credential azcore.TokenCrede // connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -76,7 +73,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -99,7 +96,7 @@ func (client *VPNConnectionsClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, options *VPNConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VPNConnection, _ *VPNConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -122,7 +119,7 @@ func (client *VPNConnectionsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnConnectionParameters); err != nil { @@ -134,7 +131,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -161,7 +158,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -184,7 +181,7 @@ func (client *VPNConnectionsClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, _ *VPNConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -207,7 +204,7 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +213,7 @@ func (client *VPNConnectionsClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves the details of a vpn connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -244,7 +241,7 @@ func (client *VPNConnectionsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNConnectionsClientGetOptions) (*policy.Request, error) { +func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, _ *VPNConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *VPNConnectionsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +281,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNConnectionsClientListByVPNGatewayOptions contains the optional parameters for the VPNConnectionsClient.NewListByVPNGatewayPager @@ -313,7 +310,7 @@ func (client *VPNConnectionsClient) NewListByVPNGatewayPager(resourceGroupName s } // listByVPNGatewayCreateRequest creates the ListByVPNGateway request. -func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNConnectionsClientListByVPNGatewayOptions) (*policy.Request, error) { +func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *VPNConnectionsClientListByVPNGatewayOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *VPNConnectionsClient) listByVPNGatewayCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +347,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -377,7 +374,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -423,7 +420,7 @@ func (client *VPNConnectionsClient) startPacketCaptureCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -438,7 +435,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - vpnConnectionName - The name of the vpn connection. @@ -465,7 +462,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -511,7 +508,7 @@ func (client *VPNConnectionsClient) stopPacketCaptureCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go deleted file mode 100644 index 0d9fc8dc5149..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnconnections_client_example_test.go +++ /dev/null @@ -1,411 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - 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{ - { - Name: to.Ptr("Connection-Link1"), - Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - ConnectionBandwidth: to.Ptr[int32](200), - SharedKey: to.Ptr("key"), - UsePolicyBasedTrafficSelectors: to.Ptr(false), - 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"), - }, - }, - }}, - }, - }, nil) - if 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.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), - // SharedKey: to.Ptr("key"), - // 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/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1"), - // }, - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNConnectionsClient().BeginDelete(ctx, "rg1", "gateway1", "vpnConnection1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go index 8546254750ee..3716a0ea0a06 100644 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpngateways_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to create or Update a virtual wan vpn gateway. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VPNGatewaysClient) createOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, options *VPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VPNGateway, _ *VPNGatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *VPNGatewaysClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { @@ -128,7 +125,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginDeleteOptions contains the optional parameters for the VPNGatewaysClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *VPNGatewaysClient) deleteOperation(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *VPNGatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -195,7 +192,7 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *VPNGatewaysClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves the details of a virtual wan vpn gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientGetOptions contains the optional parameters for the VPNGatewaysClient.Get method. @@ -231,7 +228,7 @@ func (client *VPNGatewaysClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientGetOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, _ *VPNGatewaysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +247,7 @@ func (client *VPNGatewaysClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +264,7 @@ func (client *VPNGatewaysClient) getHandleResponse(resp *http.Response) (VPNGate // NewListPager - Lists all the VpnGateways in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -293,7 +290,7 @@ func (client *VPNGatewaysClient) NewListPager(options *VPNGatewaysClientListOpti } // listCreateRequest creates the List request. -func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options *VPNGatewaysClientListOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, _ *VPNGatewaysClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -304,7 +301,7 @@ func (client *VPNGatewaysClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +318,7 @@ func (client *VPNGatewaysClient) listHandleResponse(resp *http.Response) (VPNGat // NewListByResourceGroupPager - Lists all the VpnGateways in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - options - VPNGatewaysClientListByResourceGroupOptions contains the optional parameters for the VPNGatewaysClient.NewListByResourceGroupPager // method. @@ -349,7 +346,7 @@ func (client *VPNGatewaysClient) NewListByResourceGroupPager(resourceGroupName s } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VPNGatewaysClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -364,7 +361,7 @@ func (client *VPNGatewaysClient) listByResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +379,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginResetOptions contains the optional parameters for the VPNGatewaysClient.BeginReset method. @@ -407,7 +404,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) reset(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginResetOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginReset" @@ -449,7 +446,7 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") if options != nil && options.IPConfigurationID != nil { reqQP.Set("ipConfigurationId", *options.IPConfigurationID) } @@ -461,7 +458,7 @@ func (client *VPNGatewaysClient) resetCreateRequest(ctx context.Context, resourc // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStartPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStartPacketCapture @@ -487,7 +484,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) startPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStartPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStartPacketCapture" @@ -529,7 +526,7 @@ func (client *VPNGatewaysClient) startPacketCaptureCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -544,7 +541,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - options - VPNGatewaysClientBeginStopPacketCaptureOptions contains the optional parameters for the VPNGatewaysClient.BeginStopPacketCapture @@ -570,7 +567,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNGatewaysClient) stopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, options *VPNGatewaysClientBeginStopPacketCaptureOptions) (*http.Response, error) { var err error const operationName = "VPNGatewaysClient.BeginStopPacketCapture" @@ -612,7 +609,7 @@ func (client *VPNGatewaysClient) stopPacketCaptureCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -627,7 +624,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - vpnGatewayParameters - Parameters supplied to update a virtual wan vpn gateway tags. @@ -654,7 +651,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -677,7 +674,7 @@ func (client *VPNGatewaysClient) updateTags(ctx context.Context, resourceGroupNa } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, options *VPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { +func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject, _ *VPNGatewaysClientBeginUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -696,7 +693,7 @@ func (client *VPNGatewaysClient) updateTagsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnGatewayParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go deleted file mode 100644 index 46272975c48b..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpngateways_client_example_test.go +++ /dev/null @@ -1,1334 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - IPConfigurationID: to.Ptr("Instance0"), - }, - { - CustomBgpIPAddresses: []*string{ - to.Ptr("169.254.21.10")}, - IPConfigurationID: to.Ptr("Instance1"), - }}, - PeerWeight: to.Ptr[int32](0), - }, - Connections: []*armnetwork.VPNConnection{ - { - Name: to.Ptr("vpnConnection1"), - Properties: &armnetwork.VPNConnectionProperties{ - RemoteVPNSite: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1"), - }, - VPNLinkConnections: []*armnetwork.VPNSiteLinkConnection{ - { - Name: to.Ptr("Connection-Link1"), - Properties: &armnetwork.VPNSiteLinkConnectionProperties{ - ConnectionBandwidth: to.Ptr[int32](200), - EgressNatRules: []*armnetwork.SubResource{ - { - ID: to.Ptr("/subscriptions/subid/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"), - }, - }, - }}, - }, - }}, - EnableBgpRouteTranslationForNat: to.Ptr(false), - IsRoutingPreferenceInternet: to.Ptr(false), - NatRules: []*armnetwork.VPNGatewayNatRule{ - { - Name: to.Ptr("nat03"), - Properties: &armnetwork.VPNGatewayNatRuleProperties{ - Type: to.Ptr(armnetwork.VPNNatRuleTypeStatic), - 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"), - }, - }, - }, nil) - if 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.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), - // 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), - // SharedKey: to.Ptr("key"), - // 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/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), - // }, - // }}, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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")}, - // 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{ - // 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), - // SharedKey: to.Ptr("key"), - // }, - // }}, - // 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/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginDelete(ctx, "rg1", "gateway1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginReset(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginResetOptions{IPConfigurationID: nil}) - if 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.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")}, - // 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/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), - // SharedKey: to.Ptr("key"), - // 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/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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}]}"), - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNGatewaysClient().BeginStartPacketCapture(ctx, "rg1", "vpngw", &armnetwork.VPNGatewaysClientBeginStartPacketCaptureOptions{Parameters: nil}) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }) - if 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}\"" -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/VpnGatewayListByResourceGroup.json -func ExampleVPNGatewaysClient_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) - 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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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), - // SharedKey: to.Ptr("key"), - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go index 64b3adf16d3a..850798e53b38 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVPNLinkConnectionsClient(subscriptionID string, credential azcore.TokenC // NewGetAllSharedKeysPager - Lists all shared keys of VpnLink connection specified. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -77,7 +74,7 @@ func (client *VPNLinkConnectionsClient) NewGetAllSharedKeysPager(resourceGroupNa } // getAllSharedKeysCreateRequest creates the GetAllSharedKeys request. -func (client *VPNLinkConnectionsClient) getAllSharedKeysCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientGetAllSharedKeysOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) getAllSharedKeysCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNLinkConnectionsClientGetAllSharedKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -104,7 +101,7 @@ func (client *VPNLinkConnectionsClient) getAllSharedKeysCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +119,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -152,7 +149,7 @@ func (client *VPNLinkConnectionsClient) GetDefaultSharedKey(ctx context.Context, } // getDefaultSharedKeyCreateRequest creates the GetDefaultSharedKey request. -func (client *VPNLinkConnectionsClient) getDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientGetDefaultSharedKeyOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) getDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNLinkConnectionsClientGetDefaultSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -179,7 +176,7 @@ func (client *VPNLinkConnectionsClient) getDefaultSharedKeyCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +194,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -225,7 +222,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -248,7 +245,7 @@ func (client *VPNLinkConnectionsClient) getIkeSas(ctx context.Context, resourceG } // getIkeSasCreateRequest creates the GetIkeSas request. -func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNLinkConnectionsClientBeginGetIkeSasOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -275,7 +272,7 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ func (client *VPNLinkConnectionsClient) getIkeSasCreateRequest(ctx context.Conte // NewListByVPNConnectionPager - Retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the vpn gateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -313,7 +310,7 @@ func (client *VPNLinkConnectionsClient) NewListByVPNConnectionPager(resourceGrou } // listByVPNConnectionCreateRequest creates the ListByVPNConnection request. -func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, options *VPNLinkConnectionsClientListByVPNConnectionOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, _ *VPNLinkConnectionsClientListByVPNConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -336,7 +333,7 @@ func (client *VPNLinkConnectionsClient) listByVPNConnectionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +351,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -384,7 +381,7 @@ func (client *VPNLinkConnectionsClient) ListDefaultSharedKey(ctx context.Context } // listDefaultSharedKeyCreateRequest creates the ListDefaultSharedKey request. -func (client *VPNLinkConnectionsClient) listDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientListDefaultSharedKeyOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) listDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNLinkConnectionsClientListDefaultSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys/default/listSharedKey" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -411,7 +408,7 @@ func (client *VPNLinkConnectionsClient) listDefaultSharedKeyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -429,7 +426,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -457,7 +454,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -480,7 +477,7 @@ func (client *VPNLinkConnectionsClient) resetConnection(ctx context.Context, res } // resetConnectionCreateRequest creates the ResetConnection request. -func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNLinkConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNLinkConnectionsClientBeginResetConnectionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -507,7 +504,7 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -518,7 +515,7 @@ func (client *VPNLinkConnectionsClient) resetConnectionCreateRequest(ctx context // pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the connection. @@ -549,7 +546,7 @@ func (client *VPNLinkConnectionsClient) BeginSetOrInitDefaultSharedKey(ctx conte // pre-defined length. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -572,7 +569,7 @@ func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKey(ctx context.Co } // setOrInitDefaultSharedKeyCreateRequest creates the SetOrInitDefaultSharedKey request. -func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, connectionSharedKeyParameters ConnectionSharedKeyResult, options *VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions) (*policy.Request, error) { +func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKeyCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, connectionSharedKeyParameters ConnectionSharedKeyResult, _ *VPNLinkConnectionsClientBeginSetOrInitDefaultSharedKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -599,7 +596,7 @@ func (client *VPNLinkConnectionsClient) setOrInitDefaultSharedKeyCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectionSharedKeyParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go deleted file mode 100644 index 3a16406842f2..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnlinkconnections_client_example_test.go +++ /dev/null @@ -1,221 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNLinkConnectionsClient().NewGetAllSharedKeysPager("rg1", "gateway1", "vpnConnection1", "Connection-Link1", 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.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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNLinkConnectionsClient().GetDefaultSharedKey(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNLinkConnectionsClient().ListDefaultSharedKey(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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{ - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go index f5eb3c6ab40c..088fcb7ffb7d 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being created or updated. // - vpnServerConfigurationParameters - Parameters supplied to create or update VpnServerConfiguration. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, options *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VPNServerConfiguration, _ *VPNServerConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { @@ -128,7 +125,7 @@ func (client *VPNServerConfigurationsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being deleted. // - options - VPNServerConfigurationsClientBeginDeleteOptions contains the optional parameters for the VPNServerConfigurationsClient.BeginDelete @@ -154,7 +151,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsClient.BeginDelete" @@ -177,7 +174,7 @@ func (client *VPNServerConfigurationsClient) deleteOperation(ctx context.Context } // deleteCreateRequest creates the Delete request. -func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, _ *VPNServerConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +202,7 @@ func (client *VPNServerConfigurationsClient) deleteCreateRequest(ctx context.Con // Get - Retrieves the details of a VpnServerConfiguration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being retrieved. // - options - VPNServerConfigurationsClientGetOptions contains the optional parameters for the VPNServerConfigurationsClient.Get @@ -233,7 +230,7 @@ func (client *VPNServerConfigurationsClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, options *VPNServerConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, _ *VPNServerConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -252,7 +249,7 @@ func (client *VPNServerConfigurationsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *VPNServerConfigurationsClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all the VpnServerConfigurations in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - VPNServerConfigurationsClientListOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListPager // method. func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConfigurationsClientListOptions) *runtime.Pager[VPNServerConfigurationsClientListResponse] { @@ -296,7 +293,7 @@ func (client *VPNServerConfigurationsClient) NewListPager(options *VPNServerConf } // listCreateRequest creates the List request. -func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Context, options *VPNServerConfigurationsClientListOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Context, _ *VPNServerConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -307,7 +304,7 @@ func (client *VPNServerConfigurationsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +321,7 @@ func (client *VPNServerConfigurationsClient) listHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists all the vpnServerConfigurations in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - options - VPNServerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the VPNServerConfigurationsClient.NewListByResourceGroupPager // method. @@ -352,7 +349,7 @@ func (client *VPNServerConfigurationsClient) NewListByResourceGroupPager(resourc } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNServerConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VPNServerConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +364,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,7 @@ func (client *VPNServerConfigurationsClient) listByResourceGroupHandleResponse(r // UpdateTags - Updates VpnServerConfiguration tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnServerConfiguration. // - vpnServerConfigurationName - The name of the VpnServerConfiguration being updated. // - vpnServerConfigurationParameters - Parameters supplied to update VpnServerConfiguration tags. @@ -414,7 +411,7 @@ func (client *VPNServerConfigurationsClient) UpdateTags(ctx context.Context, res } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, options *VPNServerConfigurationsClientUpdateTagsOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject, _ *VPNServerConfigurationsClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -433,7 +430,7 @@ func (client *VPNServerConfigurationsClient) updateTagsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnServerConfigurationParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go deleted file mode 100644 index 28b65694a194..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurations_client_example_test.go +++ /dev/null @@ -1,855 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - 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), - }, - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2"), - Name: to.Ptr("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), - }, - }}, - 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), - 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)}, - }, - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNServerConfigurationsClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNServerConfigurationsClient().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.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), - // }, - // }, - // { - // 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"), - // }}, - // 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"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // 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)}, - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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"), - // }}, - // 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"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNServerConfigurationsClient().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.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), - // }, - // }, - // { - // 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"), - // }}, - // 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"), - // }}, - // RadiusServerSecret: to.Ptr(""), - // 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)}, - // }, - // }, - // { - // 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), - // }, - // }, - // { - // 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)}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go index b862307b94ed..559675bba6f3 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -20,7 +17,8 @@ import ( "strings" ) -// VPNServerConfigurationsAssociatedWithVirtualWanClient contains the methods for the VPNServerConfigurationsAssociatedWithVirtualWan group. +// VPNServerConfigurationsAssociatedWithVirtualWanClient contains the methods for the VPNServerConfigurationsAssociatedWithVirtualWan +// group. // Don't use this type directly, use NewVPNServerConfigurationsAssociatedWithVirtualWanClient() instead. type VPNServerConfigurationsAssociatedWithVirtualWanClient struct { internal *arm.Client @@ -47,7 +45,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN whose associated VpnServerConfigurations is needed. // - options - VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions contains the optional parameters for the @@ -73,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperation(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*http.Response, error) { var err error const operationName = "VPNServerConfigurationsAssociatedWithVirtualWanClient.BeginList" @@ -96,7 +94,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listOperati } // listCreateRequest creates the List request. -func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, options *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*policy.Request, error) { +func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, _ *VPNServerConfigurationsAssociatedWithVirtualWanClientBeginListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +113,7 @@ func (client *VPNServerConfigurationsAssociatedWithVirtualWanClient) listCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index a00bda865350..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnserverconfigurationsassociatedwithvirtualwan_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNServerConfigurationsAssociatedWithVirtualWanClient().BeginList(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.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")}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go index 7adeae48091c..529e3efe87a6 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnGateway. // - gatewayName - The name of the gateway. // - connectionName - The name of the vpn connection. @@ -77,7 +74,7 @@ func (client *VPNSiteLinkConnectionsClient) Get(ctx context.Context, resourceGro } // getCreateRequest creates the Get request. -func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, options *VPNSiteLinkConnectionsClientGetOptions) (*policy.Request, error) { +func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string, _ *VPNSiteLinkConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -104,7 +101,7 @@ func (client *VPNSiteLinkConnectionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 2ff608dec239..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinkconnections_client_example_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSiteLinkConnectionsClient().Get(ctx, "rg1", "gateway1", "vpnConnection1", "Connection-Link1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // SharedKey: to.Ptr("key"), - // 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/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 5e6c048c5c42..a673525fc507 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite. // - vpnSiteLinkName - The name of the VpnSiteLink being retrieved. @@ -75,7 +72,7 @@ func (client *VPNSiteLinksClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, options *VPNSiteLinksClientGetOptions) (*policy.Request, error) { +func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string, _ *VPNSiteLinksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *VPNSiteLinksClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +112,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite. // - options - VPNSiteLinksClientListByVPNSiteOptions contains the optional parameters for the VPNSiteLinksClient.NewListByVPNSitePager @@ -144,7 +141,7 @@ func (client *VPNSiteLinksClient) NewListByVPNSitePager(resourceGroupName string } // listByVPNSiteCreateRequest creates the ListByVPNSite request. -func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSiteLinksClientListByVPNSiteOptions) (*policy.Request, error) { +func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, _ *VPNSiteLinksClientListByVPNSiteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +160,7 @@ func (client *VPNSiteLinksClient) listByVPNSiteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index f6429550572c..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitelinks_client_example_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVPNSiteLinksClient().Get(ctx, "rg1", "vpnSite1", "vpnSiteLink1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSiteLinksClient().NewListByVPNSitePager("rg1", "vpnSite1", 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.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"), - // }, - // 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"), - // }, - // 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 fb6ef2604c49..8758e9913608 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsites_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being created or updated. // - vpnSiteParameters - Parameters supplied to create or update VpnSite. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VPNSitesClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, options *VPNSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VPNSite, _ *VPNSitesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *VPNSitesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { @@ -128,7 +125,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being deleted. // - options - VPNSitesClientBeginDeleteOptions contains the optional parameters for the VPNSitesClient.BeginDelete method. @@ -153,7 +150,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VPNSitesClient.BeginDelete" @@ -176,7 +173,7 @@ func (client *VPNSitesClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, _ *VPNSitesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -195,7 +192,7 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +201,7 @@ func (client *VPNSitesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieves the details of a VPN site. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being retrieved. // - options - VPNSitesClientGetOptions contains the optional parameters for the VPNSitesClient.Get method. @@ -231,7 +228,7 @@ func (client *VPNSitesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, options *VPNSitesClientGetOptions) (*policy.Request, error) { +func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, _ *VPNSitesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +247,7 @@ func (client *VPNSitesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +264,7 @@ func (client *VPNSitesClient) getHandleResponse(resp *http.Response) (VPNSitesCl // NewListPager - Lists all the VpnSites in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -293,7 +290,7 @@ func (client *VPNSitesClient) NewListPager(options *VPNSitesClientListOptions) * } // listCreateRequest creates the List request. -func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VPNSitesClientListOptions) (*policy.Request, error) { +func (client *VPNSitesClient) listCreateRequest(ctx context.Context, _ *VPNSitesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -304,7 +301,7 @@ func (client *VPNSitesClient) listCreateRequest(ctx context.Context, options *VP return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +318,7 @@ func (client *VPNSitesClient) listHandleResponse(resp *http.Response) (VPNSitesC // NewListByResourceGroupPager - Lists all the vpnSites in a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - options - VPNSitesClientListByResourceGroupOptions contains the optional parameters for the VPNSitesClient.NewListByResourceGroupPager // method. @@ -349,7 +346,7 @@ func (client *VPNSitesClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VPNSitesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VPNSitesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -364,7 +361,7 @@ func (client *VPNSitesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +379,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name of the VpnSite. // - vpnSiteName - The name of the VpnSite being updated. // - vpnSiteParameters - Parameters supplied to update VpnSite tags. @@ -410,7 +407,7 @@ func (client *VPNSitesClient) UpdateTags(ctx context.Context, resourceGroupName } // updateTagsCreateRequest creates the UpdateTags request. -func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, options *VPNSitesClientUpdateTagsOptions) (*policy.Request, error) { +func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject, _ *VPNSitesClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -429,7 +426,7 @@ func (client *VPNSitesClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vpnSiteParameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go deleted file mode 100644 index dc78c900a69d..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsites_client_example_test.go +++ /dev/null @@ -1,464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, - IsSecuritySite: to.Ptr(false), - O365Policy: &armnetwork.O365PolicyProperties{ - BreakOutCategories: &armnetwork.O365BreakOutCategoryPolicies{ - Default: to.Ptr(false), - Allow: to.Ptr(true), - Optimize: to.Ptr(true), - }, - }, - VirtualWan: &armnetwork.SubResource{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1"), - }, - VPNSiteLinks: []*armnetwork.VPNSiteLink{ - { - Name: to.Ptr("vpnSiteLink1"), - Properties: &armnetwork.VPNSiteLinkProperties{ - BgpProperties: &armnetwork.VPNLinkBgpSettings{ - Asn: to.Ptr[int64](1234), - BgpPeeringAddress: to.Ptr("192.168.0.0"), - }, - Fqdn: to.Ptr("link1.vpnsite1.contoso.com"), - IPAddress: to.Ptr("50.50.50.56"), - LinkProperties: &armnetwork.VPNLinkProviderProperties{ - LinkProviderName: to.Ptr("vendor1"), - LinkSpeedInMbps: to.Ptr[int32](0), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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("", 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.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{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVPNSitesClient().BeginDelete(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSitesClient().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.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")}, - // }, - // 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{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // 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\\"), - // 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"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVPNSitesClient().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.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")}, - // }, - // 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{ - // LinkSpeedInMbps: to.Ptr[int32](0), - // }, - // ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded), - // }, - // }}, - // }, - // }, - // { - // 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\\"), - // 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"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go index 188692f1070b..91beee49f69c 100644 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go +++ b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The resource group name. // - virtualWANName - The name of the VirtualWAN for which configuration of all vpn-sites is needed. // - request - Parameters supplied to download vpn-sites configuration. @@ -74,7 +71,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -97,7 +94,7 @@ func (client *VPNSitesConfigurationClient) download(ctx context.Context, resourc } // downloadCreateRequest creates the Download request. -func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, options *VPNSitesConfigurationClientBeginDownloadOptions) (*policy.Request, error) { +func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVPNSitesConfigurationRequest, _ *VPNSitesConfigurationClientBeginDownloadOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +113,7 @@ func (client *VPNSitesConfigurationClient) downloadCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, request); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go b/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go deleted file mode 100644 index 3253a414212a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/vpnsitesconfiguration_client_example_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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")}, - }, 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/watchers_client.go b/sdk/resourcemanager/network/armnetwork/watchers_client.go index a362961040ba..5e1a6dc8cda1 100644 --- a/sdk/resourcemanager/network/armnetwork/watchers_client.go +++ b/sdk/resourcemanager/network/armnetwork/watchers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewWatchersClient(subscriptionID string, credential azcore.TokenCredential, // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that determine how the connectivity check will be performed. @@ -76,7 +73,7 @@ func (client *WatchersClient) BeginCheckConnectivity(ctx context.Context, resour // endpoint including another VM or an arbitrary remote server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -99,7 +96,7 @@ 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, options *WatchersClientBeginCheckConnectivityOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -118,7 +115,7 @@ func (client *WatchersClient) checkConnectivityCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -130,7 +127,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the network watcher resource. @@ -158,7 +155,7 @@ 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, options *WatchersClientCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -177,7 +174,7 @@ func (client *WatchersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -198,7 +195,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientBeginDeleteOptions contains the optional parameters for the WatchersClient.BeginDelete method. @@ -223,7 +220,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WatchersClient.BeginDelete" @@ -246,7 +243,7 @@ func (client *WatchersClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, networkWatcherName string, options *WatchersClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -265,7 +262,7 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +271,7 @@ func (client *WatchersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the specified network watcher by resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - options - WatchersClientGetOptions contains the optional parameters for the WatchersClient.Get method. @@ -301,7 +298,7 @@ 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, options *WatchersClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -320,7 +317,7 @@ func (client *WatchersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +336,7 @@ func (client *WatchersClient) getHandleResponse(resp *http.Response) (WatchersCl // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that determine Azure reachability report configuration. @@ -367,7 +364,7 @@ func (client *WatchersClient) BeginGetAzureReachabilityReport(ctx context.Contex // 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -390,7 +387,7 @@ 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, options *WatchersClientBeginGetAzureReachabilityReportOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -409,7 +406,7 @@ func (client *WatchersClient) getAzureReachabilityReportCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -421,7 +418,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define a resource to query flow log and traffic analytics (optional) status. @@ -448,7 +445,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -471,7 +468,7 @@ 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, options *WatchersClientBeginGetFlowLogStatusOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -490,7 +487,7 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -506,7 +503,7 @@ func (client *WatchersClient) getFlowLogStatusCreateRequest(ctx context.Context, // the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters to get network configuration diagnostic. @@ -537,7 +534,7 @@ func (client *WatchersClient) BeginGetNetworkConfigurationDiagnostic(ctx context // the specified flow and the evaluation results. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -560,7 +557,7 @@ 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, options *WatchersClientBeginGetNetworkConfigurationDiagnosticOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -579,7 +576,7 @@ func (client *WatchersClient) getNetworkConfigurationDiagnosticCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -591,7 +588,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the source and destination endpoint. @@ -618,7 +615,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -641,7 +638,7 @@ 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, options *WatchersClientBeginGetNextHopOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -660,7 +657,7 @@ func (client *WatchersClient) getNextHopCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -672,7 +669,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the representation of topology. @@ -700,7 +697,7 @@ 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, options *WatchersClientGetTopologyOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -719,7 +716,7 @@ func (client *WatchersClient) getTopologyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -740,7 +737,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the resource to troubleshoot. @@ -767,7 +764,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -790,7 +787,7 @@ 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, options *WatchersClientBeginGetTroubleshootingOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -809,7 +806,7 @@ func (client *WatchersClient) getTroubleshootingCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -821,7 +818,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the resource to query the troubleshooting result. @@ -848,7 +845,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -871,7 +868,7 @@ 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, options *WatchersClientBeginGetTroubleshootingResultOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -890,7 +887,7 @@ func (client *WatchersClient) getTroubleshootingResultCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -902,7 +899,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the VM to check security groups for. @@ -929,7 +926,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -952,7 +949,7 @@ 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, options *WatchersClientBeginGetVMSecurityRulesOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -971,7 +968,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -982,7 +979,7 @@ func (client *WatchersClient) getVMSecurityRulesCreateRequest(ctx context.Contex // NewListPager - Gets all network watchers by resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - WatchersClientListOptions contains the optional parameters for the WatchersClient.NewListPager method. func (client *WatchersClient) NewListPager(resourceGroupName string, options *WatchersClientListOptions) *runtime.Pager[WatchersClientListResponse] { @@ -1010,7 +1007,7 @@ func (client *WatchersClient) NewListPager(resourceGroupName string, options *Wa } // listCreateRequest creates the List request. -func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WatchersClientListOptions) (*policy.Request, error) { +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") @@ -1025,7 +1022,7 @@ func (client *WatchersClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1042,7 +1039,7 @@ func (client *WatchersClient) listHandleResponse(resp *http.Response) (WatchersC // NewListAllPager - Gets all network watchers by subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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]{ @@ -1069,7 +1066,7 @@ func (client *WatchersClient) NewListAllPager(options *WatchersClientListAllOpti } // listAllCreateRequest creates the ListAll request. -func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options *WatchersClientListAllOptions) (*policy.Request, error) { +func (client *WatchersClient) listAllCreateRequest(ctx context.Context, _ *WatchersClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1080,7 +1077,7 @@ func (client *WatchersClient) listAllCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1099,7 +1096,7 @@ func (client *WatchersClient) listAllHandleResponse(resp *http.Response) (Watche // available internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that scope the list of available providers. @@ -1127,7 +1124,7 @@ func (client *WatchersClient) BeginListAvailableProviders(ctx context.Context, r // internet service providers for a specified Azure region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-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" @@ -1150,7 +1147,7 @@ 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, options *WatchersClientBeginListAvailableProvidersOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1169,7 +1166,7 @@ func (client *WatchersClient) listAvailableProvidersCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1181,7 +1178,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the network watcher resource group. // - networkWatcherName - The name of the network watcher resource. // - parameters - Parameters that define the configuration of flow log. @@ -1208,7 +1205,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1231,7 +1228,7 @@ 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, options *WatchersClientBeginSetFlowLogConfigurationOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1250,7 +1247,7 @@ func (client *WatchersClient) setFlowLogConfigurationCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1262,7 +1259,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters supplied to update network watcher tags. @@ -1290,7 +1287,7 @@ 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, options *WatchersClientUpdateTagsOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1309,7 +1306,7 @@ func (client *WatchersClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1330,7 +1327,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - networkWatcherName - The name of the network watcher. // - parameters - Parameters that define the IP flow to be verified. @@ -1357,7 +1354,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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" @@ -1380,7 +1377,7 @@ 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, options *WatchersClientBeginVerifyIPFlowOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1399,7 +1396,7 @@ func (client *WatchersClient) verifyIPFlowCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go b/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go deleted file mode 100644 index 7f49659cc1fe..000000000000 --- a/sdk/resourcemanager/network/armnetwork/watchers_client_example_test.go +++ /dev/null @@ -1,933 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - 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{ - // }, - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWatchersClient().BeginDelete(ctx, "rg1", "nw1", 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/NetworkWatcherListAll.json -func ExampleWatchersClient_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.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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // { - // 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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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), - }, nil) - if 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.VerificationIPFlowResult = armnetwork.VerificationIPFlowResult{ - // Access: to.Ptr(armnetwork.AccessAllow), - // RuleName: to.Ptr("Rule1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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{ - // { - // 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("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), - // }, - // }}, - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - StoragePath: to.Ptr("https://st1.blob.core.windows.net/cn1"), - }, - TargetResourceID: to.Ptr("/subscriptions/subid/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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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"), - // }, - // { - // 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}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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"), - // }}, - // 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}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - }, nil) - if 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, - 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 }()), - }, nil) - if 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.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}()), - // }, - // { - // 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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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"), - // }}, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - 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"), - }, nil) - if 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.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"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go index 843ed65556e0..70f1e67b6e78 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewall_live_test.go @@ -16,7 +16,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/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v7" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go index d4d5049a6f81..af819736b5da 100644 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go +++ b/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - parameters - Policy to be created. @@ -76,7 +73,7 @@ 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, options *WebApplicationFirewallPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -95,7 +92,7 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +113,7 @@ func (client *WebApplicationFirewallPoliciesClient) createOrUpdateHandleResponse // BeginDelete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientBeginDeleteOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.BeginDelete @@ -142,7 +139,7 @@ func (client *WebApplicationFirewallPoliciesClient) BeginDelete(ctx context.Cont // Delete - Deletes Policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WebApplicationFirewallPoliciesClient.BeginDelete" @@ -165,7 +162,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteOperation(ctx context. } // deleteCreateRequest creates the Delete request. -func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -184,7 +181,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +190,7 @@ func (client *WebApplicationFirewallPoliciesClient) deleteCreateRequest(ctx cont // 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 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - policyName - The name of the policy. // - options - WebApplicationFirewallPoliciesClientGetOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.Get @@ -221,7 +218,7 @@ func (client *WebApplicationFirewallPoliciesClient) Get(ctx context.Context, res } // getCreateRequest creates the Get request. -func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *WebApplicationFirewallPoliciesClientGetOptions) (*policy.Request, error) { +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 resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -240,7 +237,7 @@ func (client *WebApplicationFirewallPoliciesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +254,7 @@ func (client *WebApplicationFirewallPoliciesClient) getHandleResponse(resp *http // NewListPager - Lists all of the protection policies within a resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - resourceGroupName - The name of the resource group. // - options - WebApplicationFirewallPoliciesClientListOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListPager // method. @@ -285,7 +282,7 @@ func (client *WebApplicationFirewallPoliciesClient) NewListPager(resourceGroupNa } // listCreateRequest creates the List request. -func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *WebApplicationFirewallPoliciesClientListOptions) (*policy.Request, error) { +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") @@ -300,7 +297,7 @@ func (client *WebApplicationFirewallPoliciesClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +314,7 @@ func (client *WebApplicationFirewallPoliciesClient) listHandleResponse(resp *htt // NewListAllPager - Gets all the WAF policies in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - WebApplicationFirewallPoliciesClientListAllOptions contains the optional parameters for the WebApplicationFirewallPoliciesClient.NewListAllPager // method. func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *WebApplicationFirewallPoliciesClientListAllOptions) *runtime.Pager[WebApplicationFirewallPoliciesClientListAllResponse] { @@ -344,7 +341,7 @@ func (client *WebApplicationFirewallPoliciesClient) NewListAllPager(options *Web } // listAllCreateRequest creates the ListAll request. -func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx context.Context, options *WebApplicationFirewallPoliciesClientListAllOptions) (*policy.Request, error) { +func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx context.Context, _ *WebApplicationFirewallPoliciesClientListAllOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -355,7 +352,7 @@ func (client *WebApplicationFirewallPoliciesClient) listAllCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index e2a717d7cfb8..000000000000 --- a/sdk/resourcemanager/network/armnetwork/webapplicationfirewallpolicies_client_example_test.go +++ /dev/null @@ -1,1383 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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{ - // { - // 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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-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), - // }}, - // 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{ - // { - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebApplicationFirewallPoliciesClient().CreateOrUpdate(ctx, "rg1", "Policy1", armnetwork.WebApplicationFirewallPolicy{ - 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), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }}, - Priority: to.Ptr[int32](1), - RuleType: to.Ptr(armnetwork.WebApplicationFirewallRuleTypeMatchRule), - }, - { - 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), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }, - { - MatchValues: []*string{ - 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), - }, - { - 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), - }}, - Operator: to.Ptr(armnetwork.WebApplicationFirewallOperatorIPMatch), - }, - { - MatchValues: []*string{ - 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), - }}, - 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{ - { - 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{ - 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), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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")}, - // 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{ - // { - // 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{ - // { - // 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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWebApplicationFirewallPoliciesClient().BeginDelete(ctx, "rg1", "Policy1", 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/webcategories_client.go b/sdk/resourcemanager/network/armnetwork/webcategories_client.go index dfeb408bb966..4e9b7d439b3f 100644 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client.go +++ b/sdk/resourcemanager/network/armnetwork/webcategories_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ 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 2024-05-01 +// Generated from API version 2024-07-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) { @@ -91,7 +88,7 @@ func (client *WebCategoriesClient) getCreateRequest(ctx context.Context, name st if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +105,7 @@ func (client *WebCategoriesClient) getHandleResponse(resp *http.Response) (WebCa // NewListBySubscriptionPager - Gets all the Azure Web Categories in a subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-07-01 // - options - WebCategoriesClientListBySubscriptionOptions contains the optional parameters for the WebCategoriesClient.NewListBySubscriptionPager // method. func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCategoriesClientListBySubscriptionOptions) *runtime.Pager[WebCategoriesClientListBySubscriptionResponse] { @@ -135,7 +132,7 @@ func (client *WebCategoriesClient) NewListBySubscriptionPager(options *WebCatego } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.Context, options *WebCategoriesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *WebCategoriesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -146,7 +143,7 @@ func (client *WebCategoriesClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-07-01") req.Raw().URL.RawQuery = reqQP.Encode() 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 deleted file mode 100644 index 7024a0b8014a..000000000000 --- a/sdk/resourcemanager/network/armnetwork/webcategories_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebCategoriesClient().Get(ctx, "Arts", &armnetwork.WebCategoriesClientGetOptions{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.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/ab04533261eff228f28e08900445d0edef3eb70c/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/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) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebCategoriesClient().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.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"), - // }, - // }}, - // } - } -}