From 8d20b7e2c5e4839a9e9d70b368ad8dd5057934f0 Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-azure <> Date: Fri, 10 Jan 2025 07:04:39 +0000 Subject: [PATCH] Updating based on e223c8a34 --- .../2024-09-01/agentpools/README.md | 156 ++ .../2024-09-01/agentpools/client.go | 26 + .../2024-09-01/agentpools/constants.go | 561 ++++++ .../2024-09-01/agentpools/id_agentpool.go | 139 ++ .../agentpools/id_agentpool_test.go} | 137 +- .../agentpools/method_abortlatestoperation.go | 70 + .../agentpools/method_createorupdate.go | 108 ++ .../2024-09-01/agentpools/method_delete.go | 102 ++ .../agentpools/method_deletemachines.go} | 24 +- .../2024-09-01/agentpools}/method_get.go | 11 +- .../method_getavailableagentpoolversions.go | 55 + .../agentpools/method_getupgradeprofile.go} | 14 +- .../2024-09-01/agentpools/method_list.go | 106 ++ .../method_upgradenodeimageversion.go | 71 + .../2024-09-01/agentpools/model_agentpool.go | 11 + .../model_agentpoolavailableversions.go | 11 + ...el_agentpoolavailableversionsproperties.go | 8 + ...sionspropertiesagentpoolversionsinlined.go | 10 + ...model_agentpooldeletemachinesparameter.go} | 6 +- .../model_agentpoolnetworkprofile.go | 10 + .../model_agentpoolsecurityprofile.go | 9 + .../model_agentpoolupgradeprofile.go | 11 + ...model_agentpoolupgradeprofileproperties.go | 11 + ...upgradeprofilepropertiesupgradesinlined.go | 9 + .../model_agentpoolupgradesettings.go | 10 + .../model_agentpoolwindowsprofile.go | 8 + .../agentpools/model_creationdata.go} | 6 +- .../2024-09-01/agentpools/model_iptag.go | 9 + .../agentpools/model_kubeletconfig.go | 18 + .../agentpools/model_linuxosconfig.go | 11 + ...anagedclusteragentpoolprofileproperties.go | 57 + .../2024-09-01/agentpools/model_portrange.go | 10 + .../agentpools/model_powerstate.go} | 6 +- .../agentpools/model_sysctlconfig.go | 35 + .../2024-09-01/agentpools}/predicates.go | 6 +- .../2024-09-01/agentpools/version.go | 10 + .../containerservice/2024-09-01/client.go | 100 ++ .../2024-09-01/machines/README.md | 53 + .../2024-09-01/machines/client.go | 26 + .../2024-09-01/machines/constants.go | 51 + .../2024-09-01/machines/id_agentpool.go | 139 ++ .../2024-09-01/machines/id_agentpool_test.go} | 137 +- .../2024-09-01/machines/id_machine.go | 148 ++ .../2024-09-01/machines/id_machine_test.go | 372 ++++ .../2024-09-01/machines}/method_get.go | 11 +- .../2024-09-01/machines/method_list.go | 105 ++ .../2024-09-01/machines/model_machine.go | 11 + .../machines/model_machineipaddress.go | 9 + .../model_machinenetworkproperties.go | 8 + .../machines/model_machineproperties.go | 9 + .../2024-09-01/machines}/predicates.go | 6 +- .../2024-09-01/machines/version.go | 10 + .../maintenanceconfigurations/README.md | 91 + .../maintenanceconfigurations/client.go | 26 + .../maintenanceconfigurations/constants.go | 116 ++ .../id_maintenanceconfiguration.go | 139 ++ .../id_maintenanceconfiguration_test.go | 327 ++++ .../method_createorupdate.go | 11 +- .../method_delete.go} | 14 +- .../maintenanceconfigurations}/method_get.go | 11 +- .../method_listbymanagedcluster.go | 106 ++ .../model_absolutemonthlyschedule.go | 9 + .../model_dailyschedule.go} | 6 +- .../model_datespan.go | 9 + .../model_maintenanceconfiguration.go | 16 + ...odel_maintenanceconfigurationproperties.go | 10 + .../model_maintenancewindow.go | 13 + .../model_relativemonthlyschedule.go | 10 + .../model_schedule.go | 11 + .../model_timeinweek.go | 9 + .../model_timespan.go | 39 + .../model_weeklyschedule.go | 9 + .../maintenanceconfigurations}/predicates.go | 6 +- .../maintenanceconfigurations/version.go | 10 + .../2024-09-01/managedclusters/README.md | 423 +++++ .../2024-09-01/managedclusters/client.go | 26 + .../2024-09-01/managedclusters/constants.go | 1549 +++++++++++++++++ .../managedclusters/id_accessprofile.go | 139 ++ .../managedclusters/id_accessprofile_test.go | 327 ++++ .../managedclusters/id_commandresult.go | 139 ++ .../managedclusters/id_commandresult_test.go} | 137 +- .../2024-09-01/managedclusters/id_location.go | 121 ++ .../managedclusters/id_location_test.go | 237 +++ .../managedclusters/id_meshrevisionprofile.go | 130 ++ .../id_meshrevisionprofile_test.go | 282 +++ .../managedclusters/id_meshupgradeprofile.go | 139 ++ .../id_meshupgradeprofile_test.go | 327 ++++ .../method_abortlatestoperation.go | 71 + .../managedclusters/method_createorupdate.go | 109 ++ .../managedclusters}/method_delete.go | 39 +- .../2024-09-01/managedclusters/method_get.go | 54 + .../method_getaccessprofile.go | 54 + .../method_getcommandresult.go | 54 + .../method_getmeshrevisionprofile.go | 53 + .../method_getmeshupgradeprofile.go | 53 + .../method_getupgradeprofile.go | 55 + .../2024-09-01/managedclusters/method_list.go | 106 ++ .../method_listbyresourcegroup.go | 106 ++ .../method_listclusteradmincredentials.go | 84 + ...od_listclustermonitoringusercredentials.go | 84 + .../method_listclusterusercredentials.go | 88 + .../method_listkubernetesversions.go | 54 + .../method_listmeshrevisionprofiles.go | 105 ++ .../method_listmeshupgradeprofiles.go | 106 ++ ...istoutboundnetworkdependenciesendpoints.go | 106 ++ .../method_resetaadprofile.go} | 22 +- .../method_resetserviceprincipalprofile.go | 75 + .../method_rotateclustercertificates.go | 71 + .../method_rotateserviceaccountsigningkeys.go | 71 + .../managedclusters/method_runcommand.go | 76 + .../managedclusters/method_start.go | 71 + .../2024-09-01/managedclusters/method_stop.go | 71 + .../managedclusters/method_updatetags.go | 104 ++ .../managedclusters/model_accessprofile.go | 8 + .../model_advancednetworking.go | 10 + .../model_advancednetworkingobservability.go | 8 + .../model_advancednetworkingsecurity.go | 8 + .../model_agentpoolnetworkprofile.go | 10 + .../model_agentpoolsecurityprofile.go | 9 + .../model_agentpoolupgradesettings.go | 10 + .../model_agentpoolwindowsprofile.go | 8 + .../managedclusters/model_azurekeyvaultkms.go | 11 + .../model_clusterupgradesettings.go | 8 + .../model_commandresultproperties.go | 43 + .../model_compatibleversions.go | 9 + .../model_containerservicelinuxprofile.go | 9 + .../model_containerservicenetworkprofile.go | 23 + .../model_containerservicesshconfiguration.go | 8 + .../model_containerservicesshpublickey.go | 8 + .../managedclusters/model_creationdata.go | 8 + .../managedclusters/model_credentialresult.go | 9 + .../model_credentialresults.go | 8 + .../model_endpointdependency.go | 9 + .../managedclusters/model_endpointdetail.go | 11 + .../2024-09-01/managedclusters/model_iptag.go | 9 + .../model_istiocertificateauthority.go} | 6 +- .../managedclusters/model_istiocomponents.go | 9 + .../model_istioegressgateway.go | 8 + .../model_istioingressgateway.go | 9 + .../model_istioplugincertificateauthority.go | 12 + .../managedclusters/model_istioservicemesh.go | 10 + .../managedclusters/model_kubeletconfig.go | 18 + .../model_kubernetespatchversion.go | 8 + .../model_kubernetesversion.go | 12 + .../model_kubernetesversioncapabilities.go} | 6 +- .../model_kubernetesversionlistresult.go | 8 + .../managedclusters/model_linuxosconfig.go | 11 + .../managedclusters/model_managedcluster.go | 24 + .../model_managedclusteraadprofile.go | 14 + .../model_managedclusteraccessprofile.go | 18 + .../model_managedclusteraddonprofile.go | 10 + .../model_managedclusteragentpoolprofile.go | 58 + ...el_managedclusterapiserveraccessprofile.go | 12 + .../model_managedclusterautoupgradeprofile.go | 9 + ...model_managedclusterazuremonitorprofile.go | 8 + ...sterazuremonitorprofilekubestatemetrics.go | 9 + ...anagedclusterazuremonitorprofilemetrics.go | 9 + .../model_managedclustercostanalysis.go | 8 + .../model_managedclusterhttpproxyconfig.go | 11 + .../model_managedclusteringressprofile.go | 8 + ...nagedclusteringressprofilewebapprouting.go | 10 + ...model_managedclusterloadbalancerprofile.go | 15 + ...erloadbalancerprofilemanagedoutboundips.go | 9 + ...erloadbalancerprofileoutboundipprefixes.go | 8 + ...edclusterloadbalancerprofileoutboundips.go | 8 + ..._managedclustermanagedoutboundipprofile.go | 8 + .../model_managedclustermetricsprofile.go | 8 + .../model_managedclusternatgatewayprofile.go | 10 + ..._managedclusternoderesourcegroupprofile.go | 8 + .../model_managedclusteroidcissuerprofile.go | 9 + .../model_managedclusterpodidentity.go | 13 + ...odel_managedclusterpodidentityexception.go | 10 + .../model_managedclusterpodidentityprofile.go | 11 + ...agedclusterpodidentityprovisioningerror.go | 8 + ...clusterpodidentityprovisioningerrorbody.go | 11 + ...nagedclusterpodidentityprovisioninginfo.go | 8 + .../model_managedclusterpoolupgradeprofile.go | 11 + ...lusterpoolupgradeprofileupgradesinlined.go | 9 + .../model_managedclusterproperties.go | 49 + ...nagedclusterpropertiesautoscalerprofile.go | 27 + .../model_managedclustersecurityprofile.go | 11 + ...l_managedclustersecurityprofiledefender.go | 9 + ...curityprofiledefendersecuritymonitoring.go | 8 + ...nagedclustersecurityprofileimagecleaner.go | 9 + ...dclustersecurityprofileworkloadidentity.go | 8 + ...l_managedclusterserviceprincipalprofile.go | 9 + .../model_managedclustersku.go | 9 + .../model_managedclusterstorageprofile.go | 11 + ...nagedclusterstorageprofileblobcsidriver.go | 8 + ...nagedclusterstorageprofilediskcsidriver.go | 8 + ...nagedclusterstorageprofilefilecsidriver.go | 8 + ...clusterstorageprofilesnapshotcontroller.go | 8 + .../model_managedclusterupgradeprofile.go | 11 + ..._managedclusterupgradeprofileproperties.go | 9 + .../model_managedclusterwindowsprofile.go | 12 + ...managedclusterworkloadautoscalerprofile.go | 9 + ...gedclusterworkloadautoscalerprofilekeda.go | 8 + ...dautoscalerprofileverticalpodautoscaler.go | 8 + .../managedclusters/model_meshrevision.go | 10 + .../model_meshrevisionprofile.go | 16 + .../model_meshrevisionprofileproperties.go | 8 + .../model_meshupgradeprofile.go | 16 + .../model_outboundenvironmentendpoint.go | 9 + .../managedclusters/model_portrange.go | 10 + .../managedclusters/model_powerstate.go | 8 + .../model_privatelinkresource.go | 13 + .../model_resourcereference.go | 8 + .../model_runcommandrequest.go | 10 + .../managedclusters/model_runcommandresult.go | 9 + .../model_servicemeshprofile.go | 9 + .../managedclusters/model_sysctlconfig.go | 35 + .../managedclusters/model_tagsobject.go | 8 + .../model_upgradeoverridesettings.go | 27 + .../model_userassignedidentity.go} | 6 +- .../model_windowsgmsaprofile.go | 10 + .../2024-09-01/managedclusters/predicates.go | 96 + .../2024-09-01/managedclusters/version.go | 10 + .../privateendpointconnections/README.md | 86 + .../privateendpointconnections/client.go | 26 + .../privateendpointconnections/constants.go | 107 ++ .../id_privateendpointconnection.go | 139 ++ .../id_privateendpointconnection_test.go | 327 ++++ .../method_delete.go | 70 + .../privateendpointconnections/method_get.go | 53 + .../privateendpointconnections/method_list.go | 55 + .../method_update.go | 14 +- .../model_privateendpoint.go | 8 + .../model_privateendpointconnection.go | 11 + ...del_privateendpointconnectionlistresult.go | 8 + ...del_privateendpointconnectionproperties.go | 10 + ...model_privatelinkserviceconnectionstate.go | 9 + .../privateendpointconnections/version.go | 10 + .../2024-09-01/privatelinkresources/README.md | 37 + .../2024-09-01/privatelinkresources/client.go | 26 + .../privatelinkresources/method_list.go | 55 + .../model_privatelinkresource.go | 13 + .../model_privatelinkresourceslistresult.go | 8 + .../privatelinkresources/version.go | 10 + .../resolveprivatelinkserviceid/README.md | 42 + .../resolveprivatelinkserviceid/client.go | 26 + .../method_post.go | 59 + .../model_privatelinkresource.go | 13 + .../resolveprivatelinkserviceid/version.go | 10 + .../2024-09-01/snapshots/README.md | 129 ++ .../2024-09-01/snapshots/client.go | 26 + .../2024-09-01/snapshots/constants.go | 139 ++ .../2024-09-01/snapshots/id_snapshot.go} | 74 +- .../2024-09-01/snapshots/id_snapshot_test.go} | 80 +- .../snapshots/method_createorupdate.go | 58 + .../2024-09-01/snapshots/method_delete.go | 47 + .../2024-09-01/snapshots/method_get.go | 53 + .../2024-09-01/snapshots/method_list.go | 106 ++ .../snapshots/method_listbyresourcegroup.go | 106 ++ .../2024-09-01/snapshots/method_updatetags.go | 57 + .../snapshots/model_creationdata.go | 8 + .../2024-09-01/snapshots/model_snapshot.go | 18 + .../snapshots/model_snapshotproperties.go | 15 + .../2024-09-01/snapshots/model_tagsobject.go | 8 + .../2024-09-01/snapshots/predicates.go | 32 + .../2024-09-01/snapshots/version.go | 10 + .../2024-09-01/trustedaccess/README.md | 100 ++ .../2024-09-01/trustedaccess/client.go | 26 + .../2024-09-01/trustedaccess/constants.go | 60 + .../2024-09-01/trustedaccess/id_location.go | 121 ++ .../trustedaccess/id_location_test.go | 237 +++ .../id_trustedaccessrolebinding.go | 139 ++ .../id_trustedaccessrolebinding_test.go | 327 ++++ .../method_rolebindingscreateorupdate.go} | 22 +- .../method_rolebindingsdelete.go | 70 + .../trustedaccess/method_rolebindingsget.go | 53 + .../trustedaccess/method_rolebindingslist.go | 106 ++ .../trustedaccess/method_roleslist.go} | 40 +- .../trustedaccess/model_trustedaccessrole.go | 10 + .../model_trustedaccessrolebinding.go} | 6 +- ...odel_trustedaccessrolebindingproperties.go | 10 + .../model_trustedaccessrolerule.go | 12 + .../2024-09-01/trustedaccess/predicates.go | 45 + .../2024-09-01/trustedaccess/version.go | 10 + .../appattachpackage/README.md | 8 +- .../appattachpackage/client.go | 0 .../appattachpackage/constants.go | 0 .../appattachpackage/id_appattachpackage.go | 0 .../id_appattachpackage_test.go | 0 .../appattachpackage/method_createorupdate.go | 0 .../appattachpackage/method_delete.go | 47 + .../appattachpackage/method_get.go | 0 .../method_listbyresourcegroup.go | 0 .../method_listbysubscription.go | 0 .../appattachpackage/method_update.go | 0 .../model_appattachpackage.go | 0 .../model_appattachpackageinfoproperties.go | 0 .../model_appattachpackagepatch.go | 1 - .../model_appattachpackagepatchproperties.go | 2 - .../model_appattachpackageproperties.go | 3 - .../model_msixpackageapplications.go | 0 .../model_msixpackagedependencies.go | 0 .../appattachpackage/predicates.go | 0 .../appattachpackage/version.go | 4 +- .../appattachpackageinfo/README.md | 6 +- .../appattachpackageinfo/client.go | 0 .../appattachpackageinfo/constants.go | 0 .../appattachpackageinfo/id_hostpool.go | 0 .../appattachpackageinfo/id_hostpool_test.go | 0 .../appattachpackageinfo/method_import.go | 0 .../model_appattachpackage.go | 0 .../model_appattachpackageinfoproperties.go | 0 .../model_appattachpackageproperties.go | 3 - .../model_importpackageinforequest.go | 0 .../model_msixpackageapplications.go | 0 .../model_msixpackagedependencies.go | 0 .../appattachpackageinfo/predicates.go | 0 .../appattachpackageinfo/version.go | 4 +- .../application/README.md | 6 +- .../application/client.go | 0 .../application/constants.go | 0 .../application/id_application.go | 0 .../application/id_application_test.go | 0 .../application/id_applicationgroup.go | 0 .../application/id_applicationgroup_test.go | 0 .../application/method_createorupdate.go | 0 .../application/method_delete.go | 0 .../application/method_get.go | 0 .../application/method_list.go | 0 .../application/method_update.go | 0 .../application/model_application.go | 0 .../application/model_applicationpatch.go | 0 .../model_applicationpatchproperties.go | 0 .../model_applicationproperties.go | 0 .../application/predicates.go | 0 .../application/version.go | 4 +- .../applicationgroup/README.md | 6 +- .../applicationgroup/client.go | 0 .../applicationgroup/constants.go | 0 .../applicationgroup/id_applicationgroup.go | 0 .../id_applicationgroup_test.go | 0 .../applicationgroup/method_createorupdate.go | 0 .../applicationgroup/method_delete.go | 0 .../applicationgroup/method_get.go | 0 .../method_listbyresourcegroup.go | 0 .../method_listbysubscription.go | 0 .../applicationgroup/method_update.go | 0 .../model_applicationgroup.go | 25 + .../model_applicationgrouppatch.go | 0 .../model_applicationgrouppatchproperties.go | 0 .../model_applicationgroupproperties.go | 0 .../applicationgroup/model_plan.go | 0 .../applicationgroup/model_sku.go | 0 .../applicationgroup/predicates.go | 0 .../applicationgroup/version.go | 4 +- .../client.go | 134 +- .../desktop/README.md | 6 +- .../desktop/client.go | 0 .../desktop/id_applicationgroup.go | 0 .../desktop/id_applicationgroup_test.go | 0 .../desktop/id_desktop.go | 0 .../desktop/id_desktop_test.go | 0 .../desktop/method_get.go | 0 .../desktop/method_list.go | 0 .../desktop/method_update.go | 0 .../desktop/model_desktop.go | 0 .../desktop/model_desktoppatch.go | 0 .../desktop/model_desktoppatchproperties.go | 0 .../desktop/model_desktopproperties.go | 0 .../desktop/predicates.go | 0 .../desktop/version.go | 4 +- .../hostpool/README.md | 6 +- .../hostpool/client.go | 0 .../hostpool/constants.go | 232 +-- .../hostpool/id_hostpool.go | 0 .../hostpool/id_hostpool_test.go | 0 .../hostpool/method_createorupdate.go | 0 .../hostpool/method_delete.go | 0 .../hostpool/method_get.go | 0 .../hostpool/method_list.go | 0 .../hostpool/method_listbyresourcegroup.go | 0 .../hostpool/method_listregistrationtokens.go | 0 .../method_retrieveregistrationtoken.go | 0 .../hostpool/method_update.go | 0 .../model_agentupdatepatchproperties.go | 0 .../hostpool/model_agentupdateproperties.go | 0 .../2024-04-03/hostpool/model_hostpool.go | 25 + .../hostpool/model_hostpoolpatch.go | 0 .../hostpool/model_hostpoolpatchproperties.go | 4 - .../hostpool/model_hostpoolproperties.go | 5 - .../model_maintenancewindowpatchproperties.go | 0 .../model_maintenancewindowproperties.go | 0 .../hostpool/model_plan.go | 0 .../hostpool/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 .../hostpool/model_registrationinfo.go | 0 .../hostpool/model_registrationinfopatch.go | 0 .../model_registrationtokenminimal.go | 0 .../hostpool/model_sku.go | 0 .../hostpool/predicates.go | 0 .../hostpool/version.go | 4 +- .../msiximage/README.md | 6 +- .../msiximage/client.go | 0 .../msiximage/id_hostpool.go | 0 .../msiximage/id_hostpool_test.go | 0 .../msiximage/method_expand.go | 0 .../msiximage/model_expandmsiximage.go | 0 .../model_expandmsiximageproperties.go | 0 .../msiximage/model_msiximageuri.go | 0 .../model_msixpackageapplications.go | 0 .../model_msixpackagedependencies.go | 0 .../msiximage/predicates.go | 0 .../msiximage/version.go | 4 +- .../msixpackage/README.md | 6 +- .../msixpackage/client.go | 0 .../msixpackage/id_hostpool.go | 0 .../msixpackage/id_hostpool_test.go | 0 .../msixpackage/id_msixpackage.go | 0 .../msixpackage/id_msixpackage_test.go | 0 .../msixpackage/method_createorupdate.go | 0 .../msixpackage/method_delete.go | 0 .../msixpackage/method_get.go | 0 .../msixpackage/method_list.go | 0 .../msixpackage/method_update.go | 0 .../msixpackage/model_msixpackage.go | 0 .../model_msixpackageapplications.go | 0 .../model_msixpackagedependencies.go | 0 .../msixpackage/model_msixpackagepatch.go | 0 .../model_msixpackagepatchproperties.go | 0 .../model_msixpackageproperties.go | 0 .../msixpackage/predicates.go | 0 .../msixpackage/version.go | 4 +- .../privatelink/README.md | 6 +- .../privatelink/client.go | 0 .../privatelink/constants.go | 0 .../privatelink/id_hostpool.go | 0 .../privatelink/id_hostpool_test.go | 0 .../id_privateendpointconnection.go | 0 .../id_privateendpointconnection_test.go | 0 .../privatelink/id_workspace.go | 0 .../privatelink/id_workspace_test.go | 0 .../id_workspaceprivateendpointconnection.go | 0 ...workspaceprivateendpointconnection_test.go | 0 ...vateendpointconnectionsdeletebyhostpool.go | 0 ...ateendpointconnectionsdeletebyworkspace.go | 0 ...privateendpointconnectionsgetbyhostpool.go | 4 +- ...rivateendpointconnectionsgetbyworkspace.go | 4 +- ...rivateendpointconnectionslistbyhostpool.go | 12 +- ...ivateendpointconnectionslistbyworkspace.go | 12 +- ...vateendpointconnectionsupdatebyhostpool.go | 4 +- ...ateendpointconnectionsupdatebyworkspace.go | 4 +- .../method_resourceslistbyhostpool.go | 0 .../method_resourceslistbyworkspace.go | 0 .../privatelink/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 0 ...privateendpointconnectionwithsystemdata.go | 16 + .../privatelink/model_privatelinkresource.go | 0 .../model_privatelinkresourceproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 .../privatelink/predicates.go | 4 +- .../privatelink/version.go | 4 +- .../scalingplan/README.md | 6 +- .../scalingplan/client.go | 0 .../scalingplan/constants.go | 7 +- .../scalingplan/id_hostpool.go | 0 .../scalingplan/id_hostpool_test.go | 0 .../scalingplan/id_scalingplan.go | 0 .../scalingplan/id_scalingplan_test.go | 0 .../scalingplan/method_create.go | 0 .../scalingplan/method_delete.go | 0 .../scalingplan/method_get.go | 0 .../scalingplan/method_listbyhostpool.go | 0 .../scalingplan/method_listbyresourcegroup.go | 0 .../scalingplan/method_listbysubscription.go | 0 .../scalingplan/method_update.go | 0 .../scalingplan/model_plan.go | 0 .../model_scalinghostpoolreference.go | 0 .../scalingplan/model_scalingplan.go | 25 + .../scalingplan/model_scalingplanpatch.go | 0 .../model_scalingplanpatchproperties.go | 0 .../model_scalingplanproperties.go | 0 .../scalingplan/model_scalingschedule.go | 0 .../scalingplan/model_sku.go | 0 .../scalingplan/model_time.go | 0 .../scalingplan/predicates.go | 0 .../scalingplan/version.go | 4 +- .../scalingplanpersonalschedule/README.md | 6 +- .../scalingplanpersonalschedule/client.go | 0 .../scalingplanpersonalschedule/constants.go | 0 .../id_personalschedule.go | 0 .../id_personalschedule_test.go | 0 .../id_scalingplan.go | 0 .../id_scalingplan_test.go | 0 .../method_create.go | 0 .../method_delete.go | 0 .../scalingplanpersonalschedule/method_get.go | 0 .../method_list.go | 0 .../method_update.go | 0 .../model_scalingplanpersonalschedule.go | 0 .../model_scalingplanpersonalschedulepatch.go | 0 ...l_scalingplanpersonalscheduleproperties.go | 0 .../scalingplanpersonalschedule/model_time.go | 0 .../scalingplanpersonalschedule/predicates.go | 0 .../scalingplanpersonalschedule/version.go | 4 +- .../scalingplanpooledschedule/README.md | 6 +- .../scalingplanpooledschedule/client.go | 0 .../scalingplanpooledschedule/constants.go | 0 .../id_pooledschedule.go | 0 .../id_pooledschedule_test.go | 0 .../id_scalingplan.go | 0 .../id_scalingplan_test.go | 0 .../method_create.go | 0 .../method_delete.go | 0 .../scalingplanpooledschedule/method_get.go | 0 .../scalingplanpooledschedule/method_list.go | 0 .../method_update.go | 0 .../model_scalingplanpooledschedule.go | 0 .../model_scalingplanpooledschedulepatch.go | 0 ...del_scalingplanpooledscheduleproperties.go | 0 .../scalingplanpooledschedule/model_time.go | 0 .../scalingplanpooledschedule/predicates.go | 0 .../scalingplanpooledschedule/version.go | 4 +- .../sessionhost/README.md | 22 +- .../sessionhost/client.go | 0 .../sessionhost/constants.go | 0 .../sessionhost/id_hostpool.go | 0 .../sessionhost/id_hostpool_test.go | 0 .../sessionhost/id_sessionhost.go | 0 .../sessionhost/id_sessionhost_test.go | 0 .../sessionhost/method_delete.go | 0 .../sessionhost/method_get.go | 0 .../sessionhost/method_list.go | 4 - .../sessionhost/method_update.go | 0 .../sessionhost/model_sessionhost.go | 0 ...el_sessionhosthealthcheckfailuredetails.go | 0 .../model_sessionhosthealthcheckreport.go | 0 .../sessionhost/model_sessionhostpatch.go | 0 .../model_sessionhostpatchproperties.go | 0 .../model_sessionhostproperties.go | 14 - .../sessionhost/predicates.go | 0 .../sessionhost/version.go | 4 +- .../startmenuitem/README.md | 6 +- .../startmenuitem/client.go | 0 .../startmenuitem/id_applicationgroup.go | 0 .../startmenuitem/id_applicationgroup_test.go | 0 .../startmenuitem/method_list.go | 0 .../startmenuitem/model_startmenuitem.go | 0 .../model_startmenuitemproperties.go | 0 .../startmenuitem/predicates.go | 0 .../startmenuitem/version.go | 4 +- .../usersession/README.md | 6 +- .../usersession/client.go | 0 .../usersession/constants.go | 0 .../usersession/id_hostpool.go | 0 .../usersession/id_hostpool_test.go | 0 .../usersession/id_sessionhost.go | 0 .../usersession/id_sessionhost_test.go | 0 .../usersession/id_usersession.go | 0 .../usersession/id_usersession_test.go | 0 .../usersession/method_delete.go | 0 .../usersession/method_disconnect.go | 0 .../usersession/method_get.go | 0 .../usersession/method_list.go | 0 .../usersession/method_listbyhostpool.go | 0 .../usersession/method_sendmessage.go | 0 .../usersession/model_sendmessage.go | 0 .../usersession/model_usersession.go | 0 .../model_usersessionproperties.go | 0 .../usersession/predicates.go | 0 .../usersession/version.go | 4 +- .../workspace/README.md | 6 +- .../workspace/client.go | 0 .../workspace/constants.go | 0 .../workspace/id_workspace.go | 0 .../workspace/id_workspace_test.go | 0 .../workspace/method_createorupdate.go | 0 .../workspace/method_delete.go | 0 .../workspace/method_get.go | 0 .../workspace/method_listbyresourcegroup.go | 0 .../workspace/method_listbysubscription.go | 0 .../workspace/method_update.go | 0 .../workspace/model_plan.go | 0 .../workspace/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 .../workspace/model_sku.go | 0 .../2024-04-03/workspace/model_workspace.go | 25 + .../workspace/model_workspacepatch.go | 0 .../model_workspacepatchproperties.go | 0 .../workspace/model_workspaceproperties.go | 0 .../workspace/predicates.go | 0 .../workspace/version.go | 4 +- .../activesessionhostconfiguration/README.md | 53 - .../activesessionhostconfiguration/client.go | 26 - .../constants.go | 180 -- .../id_hostpool.go | 130 -- .../method_listbyhostpool.go | 105 -- .../model_activedirectoryinfoproperties.go | 10 - .../model_activesessionhostconfiguration.go | 16 - ...ctivesessionhostconfigurationproperties.go | 41 - .../model_bootdiagnosticsinfoproperties.go | 9 - .../model_domaininfoproperties.go | 10 - .../model_imageinfoproperties.go | 10 - .../model_keyvaultcredentialsproperties.go | 9 - .../model_marketplaceinfoproperties.go | 11 - .../model_networkinfoproperties.go | 9 - .../model_securityinfoproperties.go | 10 - .../activesessionhostconfiguration/version.go | 10 - .../model_applicationgroup.go | 25 - .../hostpool/model_hostpool.go | 25 - .../scalingplan/model_scalingplan.go | 25 - .../sessionhostconfiguration/README.md | 87 - .../sessionhostconfiguration/client.go | 26 - .../sessionhostconfiguration/constants.go | 227 --- .../sessionhostconfiguration/id_hostpool.go | 130 -- .../method_listbyhostpool.go | 105 -- ...odel_activedirectoryinfopatchproperties.go | 8 - .../model_activedirectoryinfoproperties.go | 10 - ...odel_bootdiagnosticsinfopatchproperties.go | 9 - .../model_bootdiagnosticsinfoproperties.go | 9 - .../model_diskinfopatchproperties.go | 8 - .../model_domaininfopatchproperties.go | 8 - .../model_domaininfoproperties.go | 10 - .../model_imageinfopatchproperties.go | 10 - .../model_imageinfoproperties.go | 10 - ...odel_keyvaultcredentialspatchproperties.go | 9 - .../model_keyvaultcredentialsproperties.go | 9 - .../model_marketplaceinfopatchproperties.go | 11 - .../model_marketplaceinfoproperties.go | 11 - .../model_networkinfopatchproperties.go | 9 - .../model_networkinfoproperties.go | 9 - .../model_securityinfopatchproperties.go | 10 - .../model_securityinfoproperties.go | 10 - .../model_sessionhostconfigurationpatch.go | 8 - ...sessionhostconfigurationpatchproperties.go | 22 - ...odel_sessionhostconfigurationproperties.go | 42 - .../sessionhostconfiguration/version.go | 10 - .../sessionhostmanagement/README.md | 116 -- .../sessionhostmanagement/client.go | 26 - .../sessionhostmanagement/constants.go | 60 - .../method_initiatesessionhostupdatepost.go | 51 - .../model_erroradditionalinfo.go | 9 - .../model_errordetail.go | 12 - ...tpoolupdateconfigurationpatchproperties.go | 11 - ...l_hostpoolupdateconfigurationproperties.go | 11 - .../model_hostpoolupdatecontrolparameter.go | 9 - .../model_sessionhostmanagement.go | 16 - ..._sessionhostmanagementoperationprogress.go | 30 - .../model_sessionhostmanagementpatch.go | 8 - ...el_sessionhostmanagementpatchproperties.go | 9 - .../model_sessionhostmanagementproperties.go | 9 - ...model_sessionhostmanagementupdatestatus.go | 45 - ...ionhostmanagementupdatestatusproperties.go | 29 - .../model_updatesessionhostsrequestbody.go | 28 - .../sessionhostmanagement/version.go | 10 - .../sessionhostmanagements/README.md | 53 - .../sessionhostmanagements/client.go | 26 - .../sessionhostmanagements/id_hostpool.go | 130 -- ...l_hostpoolupdateconfigurationproperties.go | 11 - .../model_sessionhostmanagement.go | 16 - .../model_sessionhostmanagementproperties.go | 9 - .../sessionhostmanagements/version.go | 10 - .../workspace/model_workspace.go | 25 - 661 files changed, 14824 insertions(+), 3125 deletions(-) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/README.md create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/client.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/id_agentpool.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool_test.go => containerservice/2024-09-01/agentpools/id_agentpool_test.go} (53%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_abortlatestoperation.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_createorupdate.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_delete.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_update.go => containerservice/2024-09-01/agentpools/method_deletemachines.go} (60%) rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagements => containerservice/2024-09-01/agentpools}/method_get.go (75%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_getavailableagentpoolversions.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_updatestatusget.go => containerservice/2024-09-01/agentpools/method_getupgradeprofile.go} (66%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_list.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/method_upgradenodeimageversion.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpool.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversions.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionsproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_custominfoproperties.go => containerservice/2024-09-01/agentpools/model_agentpooldeletemachinesparameter.go} (58%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolnetworkprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolsecurityprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofileproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradesettings.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolwindowsprofile.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfoproperties.go => containerservice/2024-09-01/agentpools/model_creationdata.go} (59%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_iptag.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_kubeletconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_linuxosconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_managedclusteragentpoolprofileproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_portrange.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfoproperties.go => containerservice/2024-09-01/agentpools/model_powerstate.go} (59%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/model_sysctlconfig.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagements => containerservice/2024-09-01/agentpools}/predicates.go (72%) create mode 100644 resource-manager/containerservice/2024-09-01/agentpools/version.go create mode 100644 resource-manager/containerservice/2024-09-01/client.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/README.md create mode 100644 resource-manager/containerservice/2024-09-01/machines/client.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/id_agentpool.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool_test.go => containerservice/2024-09-01/machines/id_agentpool_test.go} (53%) create mode 100644 resource-manager/containerservice/2024-09-01/machines/id_machine.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/id_machine_test.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration => containerservice/2024-09-01/machines}/method_get.go (74%) create mode 100644 resource-manager/containerservice/2024-09-01/machines/method_list.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/model_machine.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/model_machineipaddress.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/model_machinenetworkproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/machines/model_machineproperties.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration => containerservice/2024-09-01/machines}/predicates.go (71%) create mode 100644 resource-manager/containerservice/2024-09-01/machines/version.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/README.md create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/client.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement => containerservice/2024-09-01/maintenanceconfigurations}/method_createorupdate.go (74%) rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhost/method_retryprovisioning.go => containerservice/2024-09-01/maintenanceconfigurations/method_delete.go} (69%) rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration => containerservice/2024-09-01/maintenanceconfigurations}/method_get.go (72%) create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_listbymanagedcluster.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_absolutemonthlyschedule.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_diskinfoproperties.go => containerservice/2024-09-01/maintenanceconfigurations/model_dailyschedule.go} (58%) create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_datespan.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfiguration.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfigurationproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenancewindow.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_relativemonthlyschedule.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_schedule.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timeinweek.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timespan.go create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_weeklyschedule.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration => containerservice/2024-09-01/maintenanceconfigurations}/predicates.go (69%) create mode 100644 resource-manager/containerservice/2024-09-01/maintenanceconfigurations/version.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/README.md create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/client.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile_test.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool_test.go => containerservice/2024-09-01/managedclusters/id_commandresult_test.go} (53%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_location.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_location_test.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile_test.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile_test.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_abortlatestoperation.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_createorupdate.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/appattachpackage => containerservice/2024-09-01/managedclusters}/method_delete.go (55%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_get.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_getaccessprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_getcommandresult.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshrevisionprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_getupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_list.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listbyresourcegroup.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listclusteradmincredentials.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listclustermonitoringusercredentials.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listclusterusercredentials.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listkubernetesversions.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshrevisionprofiles.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshupgradeprofiles.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_listoutboundnetworkdependenciesendpoints.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_controlsessionhostupdatepost.go => containerservice/2024-09-01/managedclusters/method_resetaadprofile.go} (56%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_resetserviceprincipalprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_rotateclustercertificates.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_rotateserviceaccountsigningkeys.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_runcommand.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_start.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_stop.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/method_updatetags.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_accessprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworking.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingobservability.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingsecurity.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolnetworkprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolsecurityprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolupgradesettings.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolwindowsprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_azurekeyvaultkms.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_clusterupgradesettings.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_commandresultproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_compatibleversions.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicelinuxprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicenetworkprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshconfiguration.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshpublickey.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_creationdata.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresult.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresults.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdependency.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdetail.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_iptag.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_azureactivedirectoryinfoproperties.go => containerservice/2024-09-01/managedclusters/model_istiocertificateauthority.go} (54%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_istiocomponents.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_istioegressgateway.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_istioingressgateway.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_istioplugincertificateauthority.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_istioservicemesh.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_kubeletconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetespatchversion.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversion.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_azureactivedirectoryinfoproperties.go => containerservice/2024-09-01/managedclusters/model_kubernetesversioncapabilities.go} (53%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversionlistresult.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_linuxosconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedcluster.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraadprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraccessprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraddonprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteragentpoolprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterapiserveraccessprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterautoupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilemetrics.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustercostanalysis.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterhttpproxyconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofilewebapprouting.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermanagedoutboundipprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermetricsprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternatgatewayprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternoderesourcegroupprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteroidcissuerprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentity.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityexception.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerror.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioninginfo.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpropertiesautoscalerprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefender.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileimagecleaner.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileworkloadidentity.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterserviceprincipalprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersku.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofileblobcsidriver.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilediskcsidriver.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilefilecsidriver.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofileproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterwindowsprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevision.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofileproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_meshupgradeprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_outboundenvironmentendpoint.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_portrange.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_powerstate.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_privatelinkresource.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_resourcereference.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandrequest.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandresult.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_servicemeshprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_sysctlconfig.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_tagsobject.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_upgradeoverridesettings.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfopatchproperties.go => containerservice/2024-09-01/managedclusters/model_userassignedidentity.go} (57%) create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/model_windowsgmsaprofile.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/predicates.go create mode 100644 resource-manager/containerservice/2024-09-01/managedclusters/version.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/README.md create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/client.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection_test.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/method_delete.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/method_get.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/method_list.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement => containerservice/2024-09-01/privateendpointconnections}/method_update.go (71%) create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpoint.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnection.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionlistresult.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go create mode 100644 resource-manager/containerservice/2024-09-01/privateendpointconnections/version.go create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/README.md create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/client.go create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/method_list.go create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresource.go create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresourceslistresult.go create mode 100644 resource-manager/containerservice/2024-09-01/privatelinkresources/version.go create mode 100644 resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/README.md create mode 100644 resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/client.go create mode 100644 resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/method_post.go create mode 100644 resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/model_privatelinkresource.go create mode 100644 resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/version.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/README.md create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/client.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/constants.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool.go => containerservice/2024-09-01/snapshots/id_snapshot.go} (54%) rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool_test.go => containerservice/2024-09-01/snapshots/id_snapshot_test.go} (71%) create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_createorupdate.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_delete.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_get.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_list.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_listbyresourcegroup.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/method_updatetags.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/model_creationdata.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/model_snapshot.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/model_snapshotproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/model_tagsobject.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/predicates.go create mode 100644 resource-manager/containerservice/2024-09-01/snapshots/version.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/README.md create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/client.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/constants.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/id_location.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/id_location_test.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding_test.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_createorupdate.go => containerservice/2024-09-01/trustedaccess/method_rolebindingscreateorupdate.go} (58%) create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsdelete.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsget.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingslist.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_listbyhostpool.go => containerservice/2024-09-01/trustedaccess/method_roleslist.go} (50%) create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrole.go rename resource-manager/{desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfiguration.go => containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebinding.go} (79%) create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebindingproperties.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolerule.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/predicates.go create mode 100644 resource-manager/containerservice/2024-09-01/trustedaccess/version.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/README.md (92%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/id_appattachpackage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/id_appattachpackage_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/method_createorupdate.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_delete.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/method_listbyresourcegroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/method_listbysubscription.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_appattachpackage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_appattachpackageinfoproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_appattachpackagepatch.go (90%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_appattachpackagepatchproperties.go (76%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_appattachpackageproperties.go (70%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_msixpackageapplications.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/model_msixpackagedependencies.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackage/version.go (64%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/README.md (89%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/method_import.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_appattachpackage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_appattachpackageinfoproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_appattachpackageproperties.go (71%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_importpackageinforequest.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_msixpackageapplications.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/model_msixpackagedependencies.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/appattachpackageinfo/version.go (64%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/README.md (93%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/id_application.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/id_application_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/id_applicationgroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/id_applicationgroup_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/method_createorupdate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/model_application.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/model_applicationpatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/model_applicationpatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/model_applicationproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/application/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/README.md (94%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/id_applicationgroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/id_applicationgroup_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_createorupdate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_listbyresourcegroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_listbysubscription.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/method_update.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroup.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/model_applicationgrouppatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/model_applicationgrouppatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/model_applicationgroupproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/model_plan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/model_sku.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/applicationgroup/version.go (64%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/client.go (50%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/README.md (91%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/id_applicationgroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/id_applicationgroup_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/id_desktop.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/id_desktop_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/model_desktop.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/model_desktoppatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/model_desktoppatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/model_desktopproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/desktop/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/README.md (95%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/constants.go (74%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_createorupdate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_listbyresourcegroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_listregistrationtokens.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_retrieveregistrationtoken.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_agentupdatepatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_agentupdateproperties.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpool.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_hostpoolpatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_hostpoolpatchproperties.go (84%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_hostpoolproperties.go (84%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_maintenancewindowpatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_maintenancewindowproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_plan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_privateendpoint.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_privateendpointconnection.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_privateendpointconnectionproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_registrationinfo.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_registrationinfopatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_registrationtokenminimal.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/model_sku.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/hostpool/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/README.md (85%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/method_expand.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/model_expandmsiximage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/model_expandmsiximageproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/model_msiximageuri.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/model_msixpackageapplications.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/model_msixpackagedependencies.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msiximage/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/README.md (93%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/id_msixpackage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/id_msixpackage_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/method_createorupdate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackageapplications.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackagedependencies.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackagepatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackagepatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/model_msixpackageproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/msixpackage/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/README.md (97%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_privateendpointconnection.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_privateendpointconnection_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_workspace.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_workspace_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_workspaceprivateendpointconnection.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/id_workspaceprivateendpointconnection_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsdeletebyhostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsdeletebyworkspace.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsgetbyhostpool.go (92%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsgetbyworkspace.go (92%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionslistbyhostpool.go (89%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionslistbyworkspace.go (85%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsupdatebyhostpool.go (92%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_privateendpointconnectionsupdatebyworkspace.go (92%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_resourceslistbyhostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/method_resourceslistbyworkspace.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privateendpoint.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privateendpointconnection.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privateendpointconnectionproperties.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionwithsystemdata.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privatelinkresource.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privatelinkresourceproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/predicates.go (82%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/privatelink/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/README.md (95%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/constants.go (96%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/id_scalingplan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/id_scalingplan_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_create.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_listbyhostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_listbyresourcegroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_listbysubscription.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_plan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_scalinghostpoolreference.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplan.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_scalingplanpatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_scalingplanpatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_scalingplanproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_scalingschedule.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_sku.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/model_time.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplan/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/README.md (95%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/id_personalschedule.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/id_personalschedule_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/id_scalingplan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/id_scalingplan_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/method_create.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/model_scalingplanpersonalschedule.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/model_scalingplanpersonalschedulepatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/model_scalingplanpersonalscheduleproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/model_time.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpersonalschedule/version.go (82%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/README.md (95%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/id_pooledschedule.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/id_pooledschedule_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/id_scalingplan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/id_scalingplan_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/method_create.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/model_scalingplanpooledschedule.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/model_scalingplanpooledschedulepatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/model_scalingplanpooledscheduleproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/model_time.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/scalingplanpooledschedule/version.go (82%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/README.md (80%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/id_sessionhost.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/id_sessionhost_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/method_list.go (97%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhost.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhosthealthcheckfailuredetails.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhosthealthcheckreport.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhostpatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhostpatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/model_sessionhostproperties.go (82%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/sessionhost/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/README.md (85%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/id_applicationgroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/id_applicationgroup_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/model_startmenuitem.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/model_startmenuitemproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/startmenuitem/version.go (64%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/README.md (94%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_hostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_hostpool_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_sessionhost.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_sessionhost_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_usersession.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/id_usersession_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_disconnect.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_list.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_listbyhostpool.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/method_sendmessage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/model_sendmessage.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/model_usersession.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/model_usersessionproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/usersession/version.go (65%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/README.md (94%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/client.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/constants.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/id_workspace.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/id_workspace_test.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_createorupdate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_delete.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_get.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_listbyresourcegroup.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_listbysubscription.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/method_update.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_plan.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_privateendpoint.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_privateendpointconnection.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_privateendpointconnectionproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_sku.go (100%) create mode 100644 resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspace.go rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_workspacepatch.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_workspacepatchproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/model_workspaceproperties.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/predicates.go (100%) rename resource-manager/desktopvirtualization/{2024-04-08-preview => 2024-04-03}/workspace/version.go (65%) delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/README.md delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/client.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/constants.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_listbyhostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activedirectoryinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfiguration.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfigurationproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_bootdiagnosticsinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_domaininfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_imageinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_keyvaultcredentialsproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_marketplaceinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_networkinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_securityinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/version.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroup.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplan.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/README.md delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/client.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/constants.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_listbyhostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialspatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialsproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfopatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfoproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatch.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/version.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/README.md delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/client.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/constants.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_initiatesessionhostupdatepost.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_erroradditionalinfo.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_errordetail.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationpatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdatecontrolparameter.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagement.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementoperationprogress.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatch.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatchproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatus.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatusproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_updatesessionhostsrequestbody.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/version.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/README.md delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/client.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_hostpoolupdateconfigurationproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagement.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagementproperties.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/version.go delete mode 100644 resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspace.go diff --git a/resource-manager/containerservice/2024-09-01/agentpools/README.md b/resource-manager/containerservice/2024-09-01/agentpools/README.md new file mode 100644 index 00000000000..4b4203c5cae --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/README.md @@ -0,0 +1,156 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/agentpools` Documentation + +The `agentpools` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/agentpools" +``` + + +### Client Initialization + +```go +client := agentpools.NewAgentPoolsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AgentPoolsClient.AbortLatestOperation` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AgentPoolsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +payload := agentpools.AgentPool{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload, agentpools.DefaultCreateOrUpdateOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `AgentPoolsClient.Delete` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `AgentPoolsClient.DeleteMachines` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +payload := agentpools.AgentPoolDeleteMachinesParameter{ + // ... +} + + +if err := client.DeleteMachinesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AgentPoolsClient.Get` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AgentPoolsClient.GetAvailableAgentPoolVersions` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.GetAvailableAgentPoolVersions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AgentPoolsClient.GetUpgradeProfile` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +read, err := client.GetUpgradeProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AgentPoolsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AgentPoolsClient.UpgradeNodeImageVersion` + +```go +ctx := context.TODO() +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/resource-manager/containerservice/2024-09-01/agentpools/client.go b/resource-manager/containerservice/2024-09-01/agentpools/client.go new file mode 100644 index 00000000000..c46e6323495 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/client.go @@ -0,0 +1,26 @@ +package agentpools + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolsClient struct { + Client *resourcemanager.Client +} + +func NewAgentPoolsClientWithBaseURI(sdkApi sdkEnv.Api) (*AgentPoolsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "agentpools", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AgentPoolsClient: %+v", err) + } + + return &AgentPoolsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/constants.go b/resource-manager/containerservice/2024-09-01/agentpools/constants.go new file mode 100644 index 00000000000..ee5ee18ca41 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/constants.go @@ -0,0 +1,561 @@ +package agentpools + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolMode string + +const ( + AgentPoolModeSystem AgentPoolMode = "System" + AgentPoolModeUser AgentPoolMode = "User" +) + +func PossibleValuesForAgentPoolMode() []string { + return []string{ + string(AgentPoolModeSystem), + string(AgentPoolModeUser), + } +} + +func (s *AgentPoolMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAgentPoolMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAgentPoolMode(input string) (*AgentPoolMode, error) { + vals := map[string]AgentPoolMode{ + "system": AgentPoolModeSystem, + "user": AgentPoolModeUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AgentPoolMode(input) + return &out, nil +} + +type AgentPoolType string + +const ( + AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet" + AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +func PossibleValuesForAgentPoolType() []string { + return []string{ + string(AgentPoolTypeAvailabilitySet), + string(AgentPoolTypeVirtualMachineScaleSets), + } +} + +func (s *AgentPoolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAgentPoolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAgentPoolType(input string) (*AgentPoolType, error) { + vals := map[string]AgentPoolType{ + "availabilityset": AgentPoolTypeAvailabilitySet, + "virtualmachinescalesets": AgentPoolTypeVirtualMachineScaleSets, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AgentPoolType(input) + return &out, nil +} + +type Code string + +const ( + CodeRunning Code = "Running" + CodeStopped Code = "Stopped" +) + +func PossibleValuesForCode() []string { + return []string{ + string(CodeRunning), + string(CodeStopped), + } +} + +func (s *Code) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCode(input string) (*Code, error) { + vals := map[string]Code{ + "running": CodeRunning, + "stopped": CodeStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Code(input) + return &out, nil +} + +type GPUInstanceProfile string + +const ( + GPUInstanceProfileMIGFourg GPUInstanceProfile = "MIG4g" + GPUInstanceProfileMIGOneg GPUInstanceProfile = "MIG1g" + GPUInstanceProfileMIGSeveng GPUInstanceProfile = "MIG7g" + GPUInstanceProfileMIGThreeg GPUInstanceProfile = "MIG3g" + GPUInstanceProfileMIGTwog GPUInstanceProfile = "MIG2g" +) + +func PossibleValuesForGPUInstanceProfile() []string { + return []string{ + string(GPUInstanceProfileMIGFourg), + string(GPUInstanceProfileMIGOneg), + string(GPUInstanceProfileMIGSeveng), + string(GPUInstanceProfileMIGThreeg), + string(GPUInstanceProfileMIGTwog), + } +} + +func (s *GPUInstanceProfile) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGPUInstanceProfile(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGPUInstanceProfile(input string) (*GPUInstanceProfile, error) { + vals := map[string]GPUInstanceProfile{ + "mig4g": GPUInstanceProfileMIGFourg, + "mig1g": GPUInstanceProfileMIGOneg, + "mig7g": GPUInstanceProfileMIGSeveng, + "mig3g": GPUInstanceProfileMIGThreeg, + "mig2g": GPUInstanceProfileMIGTwog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GPUInstanceProfile(input) + return &out, nil +} + +type KubeletDiskType string + +const ( + KubeletDiskTypeOS KubeletDiskType = "OS" + KubeletDiskTypeTemporary KubeletDiskType = "Temporary" +) + +func PossibleValuesForKubeletDiskType() []string { + return []string{ + string(KubeletDiskTypeOS), + string(KubeletDiskTypeTemporary), + } +} + +func (s *KubeletDiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKubeletDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKubeletDiskType(input string) (*KubeletDiskType, error) { + vals := map[string]KubeletDiskType{ + "os": KubeletDiskTypeOS, + "temporary": KubeletDiskTypeTemporary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KubeletDiskType(input) + return &out, nil +} + +type OSDiskType string + +const ( + OSDiskTypeEphemeral OSDiskType = "Ephemeral" + OSDiskTypeManaged OSDiskType = "Managed" +) + +func PossibleValuesForOSDiskType() []string { + return []string{ + string(OSDiskTypeEphemeral), + string(OSDiskTypeManaged), + } +} + +func (s *OSDiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSDiskType(input string) (*OSDiskType, error) { + vals := map[string]OSDiskType{ + "ephemeral": OSDiskTypeEphemeral, + "managed": OSDiskTypeManaged, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSDiskType(input) + return &out, nil +} + +type OSSKU string + +const ( + OSSKUAzureLinux OSSKU = "AzureLinux" + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUUbuntu OSSKU = "Ubuntu" + OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" + OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" +) + +func PossibleValuesForOSSKU() []string { + return []string{ + string(OSSKUAzureLinux), + string(OSSKUCBLMariner), + string(OSSKUUbuntu), + string(OSSKUWindowsTwoZeroOneNine), + string(OSSKUWindowsTwoZeroTwoTwo), + } +} + +func (s *OSSKU) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSSKU(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSSKU(input string) (*OSSKU, error) { + vals := map[string]OSSKU{ + "azurelinux": OSSKUAzureLinux, + "cblmariner": OSSKUCBLMariner, + "ubuntu": OSSKUUbuntu, + "windows2019": OSSKUWindowsTwoZeroOneNine, + "windows2022": OSSKUWindowsTwoZeroTwoTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSSKU(input) + return &out, nil +} + +type OSType string + +const ( + OSTypeLinux OSType = "Linux" + OSTypeWindows OSType = "Windows" +) + +func PossibleValuesForOSType() []string { + return []string{ + string(OSTypeLinux), + string(OSTypeWindows), + } +} + +func (s *OSType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSType(input string) (*OSType, error) { + vals := map[string]OSType{ + "linux": OSTypeLinux, + "windows": OSTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSType(input) + return &out, nil +} + +type Protocol string + +const ( + ProtocolTCP Protocol = "TCP" + ProtocolUDP Protocol = "UDP" +) + +func PossibleValuesForProtocol() []string { + return []string{ + string(ProtocolTCP), + string(ProtocolUDP), + } +} + +func (s *Protocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocol(input string) (*Protocol, error) { + vals := map[string]Protocol{ + "tcp": ProtocolTCP, + "udp": ProtocolUDP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Protocol(input) + return &out, nil +} + +type ScaleDownMode string + +const ( + ScaleDownModeDeallocate ScaleDownMode = "Deallocate" + ScaleDownModeDelete ScaleDownMode = "Delete" +) + +func PossibleValuesForScaleDownMode() []string { + return []string{ + string(ScaleDownModeDeallocate), + string(ScaleDownModeDelete), + } +} + +func (s *ScaleDownMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleDownMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleDownMode(input string) (*ScaleDownMode, error) { + vals := map[string]ScaleDownMode{ + "deallocate": ScaleDownModeDeallocate, + "delete": ScaleDownModeDelete, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleDownMode(input) + return &out, nil +} + +type ScaleSetEvictionPolicy string + +const ( + ScaleSetEvictionPolicyDeallocate ScaleSetEvictionPolicy = "Deallocate" + ScaleSetEvictionPolicyDelete ScaleSetEvictionPolicy = "Delete" +) + +func PossibleValuesForScaleSetEvictionPolicy() []string { + return []string{ + string(ScaleSetEvictionPolicyDeallocate), + string(ScaleSetEvictionPolicyDelete), + } +} + +func (s *ScaleSetEvictionPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleSetEvictionPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleSetEvictionPolicy(input string) (*ScaleSetEvictionPolicy, error) { + vals := map[string]ScaleSetEvictionPolicy{ + "deallocate": ScaleSetEvictionPolicyDeallocate, + "delete": ScaleSetEvictionPolicyDelete, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleSetEvictionPolicy(input) + return &out, nil +} + +type ScaleSetPriority string + +const ( + ScaleSetPriorityRegular ScaleSetPriority = "Regular" + ScaleSetPrioritySpot ScaleSetPriority = "Spot" +) + +func PossibleValuesForScaleSetPriority() []string { + return []string{ + string(ScaleSetPriorityRegular), + string(ScaleSetPrioritySpot), + } +} + +func (s *ScaleSetPriority) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleSetPriority(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleSetPriority(input string) (*ScaleSetPriority, error) { + vals := map[string]ScaleSetPriority{ + "regular": ScaleSetPriorityRegular, + "spot": ScaleSetPrioritySpot, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleSetPriority(input) + return &out, nil +} + +type WorkloadRuntime string + +const ( + WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" + WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" +) + +func PossibleValuesForWorkloadRuntime() []string { + return []string{ + string(WorkloadRuntimeOCIContainer), + string(WorkloadRuntimeWasmWasi), + } +} + +func (s *WorkloadRuntime) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWorkloadRuntime(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWorkloadRuntime(input string) (*WorkloadRuntime, error) { + vals := map[string]WorkloadRuntime{ + "ocicontainer": WorkloadRuntimeOCIContainer, + "wasmwasi": WorkloadRuntimeWasmWasi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WorkloadRuntime(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/id_agentpool.go b/resource-manager/containerservice/2024-09-01/agentpools/id_agentpool.go new file mode 100644 index 00000000000..d1db170c217 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/id_agentpool.go @@ -0,0 +1,139 @@ +package agentpools + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&AgentPoolId{}) +} + +var _ resourceids.ResourceId = &AgentPoolId{} + +// AgentPoolId is a struct representing the Resource ID for a Agent Pool +type AgentPoolId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + AgentPoolName string +} + +// NewAgentPoolID returns a new AgentPoolId struct +func NewAgentPoolID(subscriptionId string, resourceGroupName string, managedClusterName string, agentPoolName string) AgentPoolId { + return AgentPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + AgentPoolName: agentPoolName, + } +} + +// ParseAgentPoolID parses 'input' into a AgentPoolId +func ParseAgentPoolID(input string) (*AgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&AgentPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AgentPoolId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAgentPoolIDInsensitively parses 'input' case-insensitively into a AgentPoolId +// note: this method should only be used for API response data and not user input +func ParseAgentPoolIDInsensitively(input string) (*AgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&AgentPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AgentPoolId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AgentPoolId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.AgentPoolName, ok = input.Parsed["agentPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "agentPoolName", input) + } + + return nil +} + +// ValidateAgentPoolID checks that 'input' can be parsed as a Agent Pool ID +func ValidateAgentPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAgentPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Agent Pool ID +func (id AgentPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/agentPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.AgentPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Agent Pool ID +func (id AgentPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), + resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), + } +} + +// String returns a human-readable description of this Agent Pool ID +func (id AgentPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Agent Pool Name: %q", id.AgentPoolName), + } + return fmt.Sprintf("Agent Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool_test.go b/resource-manager/containerservice/2024-09-01/agentpools/id_agentpool_test.go similarity index 53% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool_test.go rename to resource-manager/containerservice/2024-09-01/agentpools/id_agentpool_test.go index 40b59c9adc3..c11edfbefce 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool_test.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/id_agentpool_test.go @@ -1,4 +1,4 @@ -package sessionhostconfiguration +package agentpools import ( "testing" @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &HostPoolId{} +var _ resourceids.ResourceId = &AgentPoolId{} -func TestNewHostPoolID(t *testing.T) { - id := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") +func TestNewAgentPoolID(t *testing.T) { + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,24 +22,28 @@ func TestNewHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostPoolName != "hostPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.AgentPoolName != "agentPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolName") } } -func TestFormatHostPoolID(t *testing.T) { - actual := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName" +func TestFormatAgentPoolID(t *testing.T) { + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseHostPoolID(t *testing.T) { +func TestParseAgentPoolID(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *AgentPoolId }{ { // Incomplete URI @@ -73,33 +77,44 @@ func TestParseHostPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolID(v.Input) + actual, err := ParseAgentPoolID(v.Input) if err != nil { if v.Error { continue @@ -119,18 +134,22 @@ func TestParseHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) } } } -func TestParseHostPoolIDInsensitively(t *testing.T) { +func TestParseAgentPoolIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *AgentPoolId }{ { // Incomplete URI @@ -189,57 +208,79 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostPoolName: "hOsTpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolIDInsensitively(v.Input) + actual, err := ParseAgentPoolIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -259,17 +300,21 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) } } } -func TestSegmentsForHostPoolId(t *testing.T) { - segments := HostPoolId{}.Segments() +func TestSegmentsForAgentPoolId(t *testing.T) { + segments := AgentPoolId{}.Segments() if len(segments) == 0 { - t.Fatalf("HostPoolId has no segments") + t.Fatalf("AgentPoolId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_abortlatestoperation.go b/resource-manager/containerservice/2024-09-01/agentpools/method_abortlatestoperation.go new file mode 100644 index 00000000000..bb6d06d7487 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_abortlatestoperation.go @@ -0,0 +1,70 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AbortLatestOperationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AbortLatestOperation ... +func (c AgentPoolsClient) AbortLatestOperation(ctx context.Context, id AgentPoolId) (result AbortLatestOperationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/abort", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AbortLatestOperationThenPoll performs AbortLatestOperation then polls until it's completed +func (c AgentPoolsClient) AbortLatestOperationThenPoll(ctx context.Context, id AgentPoolId) error { + result, err := c.AbortLatestOperation(ctx, id) + if err != nil { + return fmt.Errorf("performing AbortLatestOperation: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AbortLatestOperation: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_createorupdate.go b/resource-manager/containerservice/2024-09-01/agentpools/method_createorupdate.go new file mode 100644 index 00000000000..ac21aa2c854 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_createorupdate.go @@ -0,0 +1,108 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AgentPool +} + +type CreateOrUpdateOperationOptions struct { + IfMatch *string + IfNoneMatch *string +} + +func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { + return CreateOrUpdateOperationOptions{} +} + +func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.IfMatch != nil { + out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) + } + if o.IfNoneMatch != nil { + out.Append("If-None-Match", fmt.Sprintf("%v", *o.IfNoneMatch)) + } + return &out +} + +func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// CreateOrUpdate ... +func (c AgentPoolsClient) CreateOrUpdate(ctx context.Context, id AgentPoolId, input AgentPool, options CreateOrUpdateOperationOptions) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c AgentPoolsClient) CreateOrUpdateThenPoll(ctx context.Context, id AgentPoolId, input AgentPool, options CreateOrUpdateOperationOptions) error { + result, err := c.CreateOrUpdate(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_delete.go b/resource-manager/containerservice/2024-09-01/agentpools/method_delete.go new file mode 100644 index 00000000000..1e402c3c3f4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_delete.go @@ -0,0 +1,102 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +type DeleteOperationOptions struct { + IfMatch *string + IgnorePodDisruptionBudget *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.IfMatch != nil { + out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) + } + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IgnorePodDisruptionBudget != nil { + out.Append("ignore-pod-disruption-budget", fmt.Sprintf("%v", *o.IgnorePodDisruptionBudget)) + } + return &out +} + +// Delete ... +func (c AgentPoolsClient) Delete(ctx context.Context, id AgentPoolId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c AgentPoolsClient) DeleteThenPoll(ctx context.Context, id AgentPoolId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_update.go b/resource-manager/containerservice/2024-09-01/agentpools/method_deletemachines.go similarity index 60% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_update.go rename to resource-manager/containerservice/2024-09-01/agentpools/method_deletemachines.go index 2578bd40d2d..b07d10227fb 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_update.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_deletemachines.go @@ -1,4 +1,4 @@ -package sessionhostconfiguration +package agentpools import ( "context" @@ -14,23 +14,21 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UpdateOperationResponse struct { +type DeleteMachinesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *SessionHostConfiguration } -// Update ... -func (c SessionHostConfigurationClient) Update(ctx context.Context, id HostPoolId, input SessionHostConfigurationPatch) (result UpdateOperationResponse, err error) { +// DeleteMachines ... +func (c AgentPoolsClient) DeleteMachines(ctx context.Context, id AgentPoolId, input AgentPoolDeleteMachinesParameter) (result DeleteMachinesOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusAccepted, - http.StatusOK, }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/sessionHostConfigurations/default", id.ID()), + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/deleteMachines", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) @@ -60,15 +58,15 @@ func (c SessionHostConfigurationClient) Update(ctx context.Context, id HostPoolI return } -// UpdateThenPoll performs Update then polls until it's completed -func (c SessionHostConfigurationClient) UpdateThenPoll(ctx context.Context, id HostPoolId, input SessionHostConfigurationPatch) error { - result, err := c.Update(ctx, id, input) +// DeleteMachinesThenPoll performs DeleteMachines then polls until it's completed +func (c AgentPoolsClient) DeleteMachinesThenPoll(ctx context.Context, id AgentPoolId, input AgentPoolDeleteMachinesParameter) error { + result, err := c.DeleteMachines(ctx, id, input) if err != nil { - return fmt.Errorf("performing Update: %+v", err) + return fmt.Errorf("performing DeleteMachines: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) + return fmt.Errorf("polling after DeleteMachines: %+v", err) } return nil diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_get.go b/resource-manager/containerservice/2024-09-01/agentpools/method_get.go similarity index 75% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_get.go rename to resource-manager/containerservice/2024-09-01/agentpools/method_get.go index 2f398742f3e..ea20389e4a3 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_get.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_get.go @@ -1,8 +1,7 @@ -package sessionhostmanagements +package agentpools import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -15,18 +14,18 @@ import ( type GetOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *SessionHostManagement + Model *AgentPool } // Get ... -func (c SessionHostManagementsClient) Get(ctx context.Context, id HostPoolId) (result GetOperationResponse, err error) { +func (c AgentPoolsClient) Get(ctx context.Context, id AgentPoolId) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/sessionHostManagements/default", id.ID()), + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -44,7 +43,7 @@ func (c SessionHostManagementsClient) Get(ctx context.Context, id HostPoolId) (r return } - var model SessionHostManagement + var model AgentPool result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_getavailableagentpoolversions.go b/resource-manager/containerservice/2024-09-01/agentpools/method_getavailableagentpoolversions.go new file mode 100644 index 00000000000..685d4c2c2ec --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_getavailableagentpoolversions.go @@ -0,0 +1,55 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetAvailableAgentPoolVersionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AgentPoolAvailableVersions +} + +// GetAvailableAgentPoolVersions ... +func (c AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, id commonids.KubernetesClusterId) (result GetAvailableAgentPoolVersionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/availableAgentPoolVersions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AgentPoolAvailableVersions + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_updatestatusget.go b/resource-manager/containerservice/2024-09-01/agentpools/method_getupgradeprofile.go similarity index 66% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_updatestatusget.go rename to resource-manager/containerservice/2024-09-01/agentpools/method_getupgradeprofile.go index 223947f13cd..1810ae898b6 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_updatestatusget.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_getupgradeprofile.go @@ -1,4 +1,4 @@ -package sessionhostmanagement +package agentpools import ( "context" @@ -12,21 +12,21 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UpdateStatusGetOperationResponse struct { +type GetUpgradeProfileOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *SessionHostManagementUpdateStatus + Model *AgentPoolUpgradeProfile } -// UpdateStatusGet ... -func (c SessionHostManagementClient) UpdateStatusGet(ctx context.Context, id HostPoolId) (result UpdateStatusGetOperationResponse, err error) { +// GetUpgradeProfile ... +func (c AgentPoolsClient) GetUpgradeProfile(ctx context.Context, id AgentPoolId) (result GetUpgradeProfileOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/sessionHostManagements/default/sessionHostUpdateStatuses/default", id.ID()), + Path: fmt.Sprintf("%s/upgradeProfiles/default", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) @@ -44,7 +44,7 @@ func (c SessionHostManagementClient) UpdateStatusGet(ctx context.Context, id Hos return } - var model SessionHostManagementUpdateStatus + var model AgentPoolUpgradeProfile result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_list.go b/resource-manager/containerservice/2024-09-01/agentpools/method_list.go new file mode 100644 index 00000000000..63350a29f6d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_list.go @@ -0,0 +1,106 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AgentPool +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []AgentPool +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c AgentPoolsClient) List(ctx context.Context, id commonids.KubernetesClusterId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/agentPools", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]AgentPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c AgentPoolsClient) ListComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, AgentPoolOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AgentPoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate AgentPoolOperationPredicate) (result ListCompleteResult, err error) { + items := make([]AgentPool, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/method_upgradenodeimageversion.go b/resource-manager/containerservice/2024-09-01/agentpools/method_upgradenodeimageversion.go new file mode 100644 index 00000000000..fa6b0240a55 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/method_upgradenodeimageversion.go @@ -0,0 +1,71 @@ +package agentpools + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpgradeNodeImageVersionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AgentPool +} + +// UpgradeNodeImageVersion ... +func (c AgentPoolsClient) UpgradeNodeImageVersion(ctx context.Context, id AgentPoolId) (result UpgradeNodeImageVersionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/upgradeNodeImageVersion", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpgradeNodeImageVersionThenPoll performs UpgradeNodeImageVersion then polls until it's completed +func (c AgentPoolsClient) UpgradeNodeImageVersionThenPoll(ctx context.Context, id AgentPoolId) error { + result, err := c.UpgradeNodeImageVersion(ctx, id) + if err != nil { + return fmt.Errorf("performing UpgradeNodeImageVersion: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UpgradeNodeImageVersion: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpool.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpool.go new file mode 100644 index 00000000000..c67ae33e826 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpool.go @@ -0,0 +1,11 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPool struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversions.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversions.go new file mode 100644 index 00000000000..0b65a05c663 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversions.go @@ -0,0 +1,11 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolAvailableVersions struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties AgentPoolAvailableVersionsProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionsproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionsproperties.go new file mode 100644 index 00000000000..a8369deaba7 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionsproperties.go @@ -0,0 +1,8 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolAvailableVersionsProperties struct { + AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsInlined `json:"agentPoolVersions,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go new file mode 100644 index 00000000000..1631b3137d1 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go @@ -0,0 +1,10 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsInlined struct { + Default *bool `json:"default,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_custominfoproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpooldeletemachinesparameter.go similarity index 58% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_custominfoproperties.go rename to resource-manager/containerservice/2024-09-01/agentpools/model_agentpooldeletemachinesparameter.go index 201c051d317..f065e76b7a4 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_custominfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpooldeletemachinesparameter.go @@ -1,8 +1,8 @@ -package activesessionhostconfiguration +package agentpools // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CustomInfoProperties struct { - ResourceId string `json:"resourceId"` +type AgentPoolDeleteMachinesParameter struct { + MachineNames []string `json:"machineNames"` } diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolnetworkprofile.go new file mode 100644 index 00000000000..db217a29cc5 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolnetworkprofile.go @@ -0,0 +1,10 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolNetworkProfile struct { + AllowedHostPorts *[]PortRange `json:"allowedHostPorts,omitempty"` + ApplicationSecurityGroups *[]string `json:"applicationSecurityGroups,omitempty"` + NodePublicIPTags *[]IPTag `json:"nodePublicIPTags,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolsecurityprofile.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolsecurityprofile.go new file mode 100644 index 00000000000..78ac43a520f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolsecurityprofile.go @@ -0,0 +1,9 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolSecurityProfile struct { + EnableSecureBoot *bool `json:"enableSecureBoot,omitempty"` + EnableVTPM *bool `json:"enableVTPM,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofile.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofile.go new file mode 100644 index 00000000000..23cc2927f28 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofile.go @@ -0,0 +1,11 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpgradeProfile struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties AgentPoolUpgradeProfileProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofileproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofileproperties.go new file mode 100644 index 00000000000..5df00c96762 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofileproperties.go @@ -0,0 +1,11 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpgradeProfileProperties struct { + KubernetesVersion string `json:"kubernetesVersion"` + LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"` + OsType OSType `json:"osType"` + Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesInlined `json:"upgrades,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go new file mode 100644 index 00000000000..b45442f6cf0 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go @@ -0,0 +1,9 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpgradeProfilePropertiesUpgradesInlined struct { + IsPreview *bool `json:"isPreview,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradesettings.go new file mode 100644 index 00000000000..c7afb34fc0c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolupgradesettings.go @@ -0,0 +1,10 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpgradeSettings struct { + DrainTimeoutInMinutes *int64 `json:"drainTimeoutInMinutes,omitempty"` + MaxSurge *string `json:"maxSurge,omitempty"` + NodeSoakDurationInMinutes *int64 `json:"nodeSoakDurationInMinutes,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolwindowsprofile.go new file mode 100644 index 00000000000..d7ad07f7f69 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_agentpoolwindowsprofile.go @@ -0,0 +1,8 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolWindowsProfile struct { + DisableOutboundNat *bool `json:"disableOutboundNat,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfoproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_creationdata.go similarity index 59% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfoproperties.go rename to resource-manager/containerservice/2024-09-01/agentpools/model_creationdata.go index 3908e061bd6..88a8fe8123b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_creationdata.go @@ -1,8 +1,8 @@ -package sessionhostconfiguration +package agentpools // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DiskInfoProperties struct { - Type VirtualMachineDiskType `json:"type"` +type CreationData struct { + SourceResourceId *string `json:"sourceResourceId,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_iptag.go b/resource-manager/containerservice/2024-09-01/agentpools/model_iptag.go new file mode 100644 index 00000000000..8a805afc241 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_iptag.go @@ -0,0 +1,9 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPTag struct { + IPTagType *string `json:"ipTagType,omitempty"` + Tag *string `json:"tag,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_kubeletconfig.go b/resource-manager/containerservice/2024-09-01/agentpools/model_kubeletconfig.go new file mode 100644 index 00000000000..7d56f79880c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_kubeletconfig.go @@ -0,0 +1,18 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubeletConfig struct { + AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"` + ContainerLogMaxFiles *int64 `json:"containerLogMaxFiles,omitempty"` + ContainerLogMaxSizeMB *int64 `json:"containerLogMaxSizeMB,omitempty"` + CpuCfsQuota *bool `json:"cpuCfsQuota,omitempty"` + CpuCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` + CpuManagerPolicy *string `json:"cpuManagerPolicy,omitempty"` + FailSwapOn *bool `json:"failSwapOn,omitempty"` + ImageGcHighThreshold *int64 `json:"imageGcHighThreshold,omitempty"` + ImageGcLowThreshold *int64 `json:"imageGcLowThreshold,omitempty"` + PodMaxPids *int64 `json:"podMaxPids,omitempty"` + TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_linuxosconfig.go b/resource-manager/containerservice/2024-09-01/agentpools/model_linuxosconfig.go new file mode 100644 index 00000000000..8256b210a85 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_linuxosconfig.go @@ -0,0 +1,11 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxOSConfig struct { + SwapFileSizeMB *int64 `json:"swapFileSizeMB,omitempty"` + Sysctls *SysctlConfig `json:"sysctls,omitempty"` + TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"` + TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_managedclusteragentpoolprofileproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_managedclusteragentpoolprofileproperties.go new file mode 100644 index 00000000000..719723775f8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_managedclusteragentpoolprofileproperties.go @@ -0,0 +1,57 @@ +package agentpools + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAgentPoolProfileProperties struct { + AvailabilityZones *zones.Schema `json:"availabilityZones,omitempty"` + CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` + Count *int64 `json:"count,omitempty"` + CreationData *CreationData `json:"creationData,omitempty"` + CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty"` + ETag *string `json:"eTag,omitempty"` + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + EnableFIPS *bool `json:"enableFIPS,omitempty"` + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + HostGroupID *string `json:"hostGroupID,omitempty"` + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + KubeletDiskType *KubeletDiskType `json:"kubeletDiskType,omitempty"` + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + MaxCount *int64 `json:"maxCount,omitempty"` + MaxPods *int64 `json:"maxPods,omitempty"` + MinCount *int64 `json:"minCount,omitempty"` + Mode *AgentPoolMode `json:"mode,omitempty"` + NetworkProfile *AgentPoolNetworkProfile `json:"networkProfile,omitempty"` + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + NodeLabels *map[string]string `json:"nodeLabels,omitempty"` + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + NodeTaints *[]string `json:"nodeTaints,omitempty"` + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + OsDiskSizeGB *int64 `json:"osDiskSizeGB,omitempty"` + OsDiskType *OSDiskType `json:"osDiskType,omitempty"` + OsSKU *OSSKU `json:"osSKU,omitempty"` + OsType *OSType `json:"osType,omitempty"` + PodSubnetID *string `json:"podSubnetID,omitempty"` + PowerState *PowerState `json:"powerState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` + ScaleDownMode *ScaleDownMode `json:"scaleDownMode,omitempty"` + ScaleSetEvictionPolicy *ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + ScaleSetPriority *ScaleSetPriority `json:"scaleSetPriority,omitempty"` + SecurityProfile *AgentPoolSecurityProfile `json:"securityProfile,omitempty"` + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *AgentPoolType `json:"type,omitempty"` + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + VMSize *string `json:"vmSize,omitempty"` + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + WindowsProfile *AgentPoolWindowsProfile `json:"windowsProfile,omitempty"` + WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_portrange.go b/resource-manager/containerservice/2024-09-01/agentpools/model_portrange.go new file mode 100644 index 00000000000..45b2a562032 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_portrange.go @@ -0,0 +1,10 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PortRange struct { + PortEnd *int64 `json:"portEnd,omitempty"` + PortStart *int64 `json:"portStart,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfoproperties.go b/resource-manager/containerservice/2024-09-01/agentpools/model_powerstate.go similarity index 59% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfoproperties.go rename to resource-manager/containerservice/2024-09-01/agentpools/model_powerstate.go index 0db2bc85745..c5939d90672 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_powerstate.go @@ -1,8 +1,8 @@ -package sessionhostconfiguration +package agentpools // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CustomInfoProperties struct { - ResourceId string `json:"resourceId"` +type PowerState struct { + Code *Code `json:"code,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/agentpools/model_sysctlconfig.go b/resource-manager/containerservice/2024-09-01/agentpools/model_sysctlconfig.go new file mode 100644 index 00000000000..aa739bf4f68 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/model_sysctlconfig.go @@ -0,0 +1,35 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SysctlConfig struct { + FsAioMaxNr *int64 `json:"fsAioMaxNr,omitempty"` + FsFileMax *int64 `json:"fsFileMax,omitempty"` + FsInotifyMaxUserWatches *int64 `json:"fsInotifyMaxUserWatches,omitempty"` + FsNrOpen *int64 `json:"fsNrOpen,omitempty"` + KernelThreadsMax *int64 `json:"kernelThreadsMax,omitempty"` + NetCoreNetdevMaxBacklog *int64 `json:"netCoreNetdevMaxBacklog,omitempty"` + NetCoreOptmemMax *int64 `json:"netCoreOptmemMax,omitempty"` + NetCoreRmemDefault *int64 `json:"netCoreRmemDefault,omitempty"` + NetCoreRmemMax *int64 `json:"netCoreRmemMax,omitempty"` + NetCoreSomaxconn *int64 `json:"netCoreSomaxconn,omitempty"` + NetCoreWmemDefault *int64 `json:"netCoreWmemDefault,omitempty"` + NetCoreWmemMax *int64 `json:"netCoreWmemMax,omitempty"` + NetIPv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"` + NetIPv4NeighDefaultGcThresh1 *int64 `json:"netIpv4NeighDefaultGcThresh1,omitempty"` + NetIPv4NeighDefaultGcThresh2 *int64 `json:"netIpv4NeighDefaultGcThresh2,omitempty"` + NetIPv4NeighDefaultGcThresh3 *int64 `json:"netIpv4NeighDefaultGcThresh3,omitempty"` + NetIPv4TcpFinTimeout *int64 `json:"netIpv4TcpFinTimeout,omitempty"` + NetIPv4TcpKeepaliveProbes *int64 `json:"netIpv4TcpKeepaliveProbes,omitempty"` + NetIPv4TcpKeepaliveTime *int64 `json:"netIpv4TcpKeepaliveTime,omitempty"` + NetIPv4TcpMaxSynBacklog *int64 `json:"netIpv4TcpMaxSynBacklog,omitempty"` + NetIPv4TcpMaxTwBuckets *int64 `json:"netIpv4TcpMaxTwBuckets,omitempty"` + NetIPv4TcpTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"` + NetIPv4TcpkeepaliveIntvl *int64 `json:"netIpv4TcpkeepaliveIntvl,omitempty"` + NetNetfilterNfConntrackBuckets *int64 `json:"netNetfilterNfConntrackBuckets,omitempty"` + NetNetfilterNfConntrackMax *int64 `json:"netNetfilterNfConntrackMax,omitempty"` + VMMaxMapCount *int64 `json:"vmMaxMapCount,omitempty"` + VMSwappiness *int64 `json:"vmSwappiness,omitempty"` + VMVfsCachePressure *int64 `json:"vmVfsCachePressure,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/predicates.go b/resource-manager/containerservice/2024-09-01/agentpools/predicates.go similarity index 72% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/predicates.go rename to resource-manager/containerservice/2024-09-01/agentpools/predicates.go index 859aae14701..94a2db5c63b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/predicates.go +++ b/resource-manager/containerservice/2024-09-01/agentpools/predicates.go @@ -1,15 +1,15 @@ -package sessionhostmanagements +package agentpools // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SessionHostManagementOperationPredicate struct { +type AgentPoolOperationPredicate struct { Id *string Name *string Type *string } -func (p SessionHostManagementOperationPredicate) Matches(input SessionHostManagement) bool { +func (p AgentPoolOperationPredicate) Matches(input AgentPool) bool { if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { return false diff --git a/resource-manager/containerservice/2024-09-01/agentpools/version.go b/resource-manager/containerservice/2024-09-01/agentpools/version.go new file mode 100644 index 00000000000..7fbf53fec9d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/agentpools/version.go @@ -0,0 +1,10 @@ +package agentpools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/agentpools/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/client.go b/resource-manager/containerservice/2024-09-01/client.go new file mode 100644 index 00000000000..b09464ed64f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/client.go @@ -0,0 +1,100 @@ +package v2024_09_01 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/agentpools" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/machines" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/maintenanceconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/managedclusters" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privateendpointconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privatelinkresources" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/trustedaccess" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + AgentPools *agentpools.AgentPoolsClient + Machines *machines.MachinesClient + MaintenanceConfigurations *maintenanceconfigurations.MaintenanceConfigurationsClient + ManagedClusters *managedclusters.ManagedClustersClient + PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient + PrivateLinkResources *privatelinkresources.PrivateLinkResourcesClient + ResolvePrivateLinkServiceId *resolveprivatelinkserviceid.ResolvePrivateLinkServiceIdClient + Snapshots *snapshots.SnapshotsClient + TrustedAccess *trustedaccess.TrustedAccessClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + agentPoolsClient, err := agentpools.NewAgentPoolsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AgentPools client: %+v", err) + } + configureFunc(agentPoolsClient.Client) + + machinesClient, err := machines.NewMachinesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Machines client: %+v", err) + } + configureFunc(machinesClient.Client) + + maintenanceConfigurationsClient, err := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building MaintenanceConfigurations client: %+v", err) + } + configureFunc(maintenanceConfigurationsClient.Client) + + managedClustersClient, err := managedclusters.NewManagedClustersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ManagedClusters client: %+v", err) + } + configureFunc(managedClustersClient.Client) + + privateEndpointConnectionsClient, err := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateEndpointConnections client: %+v", err) + } + configureFunc(privateEndpointConnectionsClient.Client) + + privateLinkResourcesClient, err := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateLinkResources client: %+v", err) + } + configureFunc(privateLinkResourcesClient.Client) + + resolvePrivateLinkServiceIdClient, err := resolveprivatelinkserviceid.NewResolvePrivateLinkServiceIdClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ResolvePrivateLinkServiceId client: %+v", err) + } + configureFunc(resolvePrivateLinkServiceIdClient.Client) + + snapshotsClient, err := snapshots.NewSnapshotsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Snapshots client: %+v", err) + } + configureFunc(snapshotsClient.Client) + + trustedAccessClient, err := trustedaccess.NewTrustedAccessClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building TrustedAccess client: %+v", err) + } + configureFunc(trustedAccessClient.Client) + + return &Client{ + AgentPools: agentPoolsClient, + Machines: machinesClient, + MaintenanceConfigurations: maintenanceConfigurationsClient, + ManagedClusters: managedClustersClient, + PrivateEndpointConnections: privateEndpointConnectionsClient, + PrivateLinkResources: privateLinkResourcesClient, + ResolvePrivateLinkServiceId: resolvePrivateLinkServiceIdClient, + Snapshots: snapshotsClient, + TrustedAccess: trustedAccessClient, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/machines/README.md b/resource-manager/containerservice/2024-09-01/machines/README.md new file mode 100644 index 00000000000..ee09af37bce --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/machines` Documentation + +The `machines` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/machines" +``` + + +### Client Initialization + +```go +client := machines.NewMachinesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `MachinesClient.Get` + +```go +ctx := context.TODO() +id := machines.NewMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName", "machineName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MachinesClient.List` + +```go +ctx := context.TODO() +id := machines.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/containerservice/2024-09-01/machines/client.go b/resource-manager/containerservice/2024-09-01/machines/client.go new file mode 100644 index 00000000000..fcd8a61002f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/client.go @@ -0,0 +1,26 @@ +package machines + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MachinesClient struct { + Client *resourcemanager.Client +} + +func NewMachinesClientWithBaseURI(sdkApi sdkEnv.Api) (*MachinesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "machines", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating MachinesClient: %+v", err) + } + + return &MachinesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/machines/constants.go b/resource-manager/containerservice/2024-09-01/machines/constants.go new file mode 100644 index 00000000000..3401f05d4e3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/constants.go @@ -0,0 +1,51 @@ +package machines + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPFamily string + +const ( + IPFamilyIPvFour IPFamily = "IPv4" + IPFamilyIPvSix IPFamily = "IPv6" +) + +func PossibleValuesForIPFamily() []string { + return []string{ + string(IPFamilyIPvFour), + string(IPFamilyIPvSix), + } +} + +func (s *IPFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPFamily(input string) (*IPFamily, error) { + vals := map[string]IPFamily{ + "ipv4": IPFamilyIPvFour, + "ipv6": IPFamilyIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPFamily(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/machines/id_agentpool.go b/resource-manager/containerservice/2024-09-01/machines/id_agentpool.go new file mode 100644 index 00000000000..591db14c283 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/id_agentpool.go @@ -0,0 +1,139 @@ +package machines + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&AgentPoolId{}) +} + +var _ resourceids.ResourceId = &AgentPoolId{} + +// AgentPoolId is a struct representing the Resource ID for a Agent Pool +type AgentPoolId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + AgentPoolName string +} + +// NewAgentPoolID returns a new AgentPoolId struct +func NewAgentPoolID(subscriptionId string, resourceGroupName string, managedClusterName string, agentPoolName string) AgentPoolId { + return AgentPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + AgentPoolName: agentPoolName, + } +} + +// ParseAgentPoolID parses 'input' into a AgentPoolId +func ParseAgentPoolID(input string) (*AgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&AgentPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AgentPoolId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAgentPoolIDInsensitively parses 'input' case-insensitively into a AgentPoolId +// note: this method should only be used for API response data and not user input +func ParseAgentPoolIDInsensitively(input string) (*AgentPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&AgentPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AgentPoolId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AgentPoolId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.AgentPoolName, ok = input.Parsed["agentPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "agentPoolName", input) + } + + return nil +} + +// ValidateAgentPoolID checks that 'input' can be parsed as a Agent Pool ID +func ValidateAgentPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAgentPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Agent Pool ID +func (id AgentPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/agentPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.AgentPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Agent Pool ID +func (id AgentPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), + resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), + } +} + +// String returns a human-readable description of this Agent Pool ID +func (id AgentPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Agent Pool Name: %q", id.AgentPoolName), + } + return fmt.Sprintf("Agent Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool_test.go b/resource-manager/containerservice/2024-09-01/machines/id_agentpool_test.go similarity index 53% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool_test.go rename to resource-manager/containerservice/2024-09-01/machines/id_agentpool_test.go index 3d2ff94a569..a8bfe45062b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool_test.go +++ b/resource-manager/containerservice/2024-09-01/machines/id_agentpool_test.go @@ -1,4 +1,4 @@ -package activesessionhostconfiguration +package machines import ( "testing" @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &HostPoolId{} +var _ resourceids.ResourceId = &AgentPoolId{} -func TestNewHostPoolID(t *testing.T) { - id := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") +func TestNewAgentPoolID(t *testing.T) { + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,24 +22,28 @@ func TestNewHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostPoolName != "hostPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.AgentPoolName != "agentPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolName") } } -func TestFormatHostPoolID(t *testing.T) { - actual := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName" +func TestFormatAgentPoolID(t *testing.T) { + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseHostPoolID(t *testing.T) { +func TestParseAgentPoolID(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *AgentPoolId }{ { // Incomplete URI @@ -73,33 +77,44 @@ func TestParseHostPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolID(v.Input) + actual, err := ParseAgentPoolID(v.Input) if err != nil { if v.Error { continue @@ -119,18 +134,22 @@ func TestParseHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) } } } -func TestParseHostPoolIDInsensitively(t *testing.T) { +func TestParseAgentPoolIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *AgentPoolId }{ { // Incomplete URI @@ -189,57 +208,79 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostPoolName: "hOsTpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Expected: &AgentPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolIDInsensitively(v.Input) + actual, err := ParseAgentPoolIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -259,17 +300,21 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) } } } -func TestSegmentsForHostPoolId(t *testing.T) { - segments := HostPoolId{}.Segments() +func TestSegmentsForAgentPoolId(t *testing.T) { + segments := AgentPoolId{}.Segments() if len(segments) == 0 { - t.Fatalf("HostPoolId has no segments") + t.Fatalf("AgentPoolId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/containerservice/2024-09-01/machines/id_machine.go b/resource-manager/containerservice/2024-09-01/machines/id_machine.go new file mode 100644 index 00000000000..3cf8b2ccbf0 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/id_machine.go @@ -0,0 +1,148 @@ +package machines + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&MachineId{}) +} + +var _ resourceids.ResourceId = &MachineId{} + +// MachineId is a struct representing the Resource ID for a Machine +type MachineId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + AgentPoolName string + MachineName string +} + +// NewMachineID returns a new MachineId struct +func NewMachineID(subscriptionId string, resourceGroupName string, managedClusterName string, agentPoolName string, machineName string) MachineId { + return MachineId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + AgentPoolName: agentPoolName, + MachineName: machineName, + } +} + +// ParseMachineID parses 'input' into a MachineId +func ParseMachineID(input string) (*MachineId, error) { + parser := resourceids.NewParserFromResourceIdType(&MachineId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MachineId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseMachineIDInsensitively parses 'input' case-insensitively into a MachineId +// note: this method should only be used for API response data and not user input +func ParseMachineIDInsensitively(input string) (*MachineId, error) { + parser := resourceids.NewParserFromResourceIdType(&MachineId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MachineId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *MachineId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.AgentPoolName, ok = input.Parsed["agentPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "agentPoolName", input) + } + + if id.MachineName, ok = input.Parsed["machineName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "machineName", input) + } + + return nil +} + +// ValidateMachineID checks that 'input' can be parsed as a Machine ID +func ValidateMachineID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMachineID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Machine ID +func (id MachineId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/agentPools/%s/machines/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.AgentPoolName, id.MachineName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Machine ID +func (id MachineId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), + resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), + resourceids.StaticSegment("staticMachines", "machines", "machines"), + resourceids.UserSpecifiedSegment("machineName", "machineName"), + } +} + +// String returns a human-readable description of this Machine ID +func (id MachineId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Agent Pool Name: %q", id.AgentPoolName), + fmt.Sprintf("Machine Name: %q", id.MachineName), + } + return fmt.Sprintf("Machine (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/machines/id_machine_test.go b/resource-manager/containerservice/2024-09-01/machines/id_machine_test.go new file mode 100644 index 00000000000..a94383704e7 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/id_machine_test.go @@ -0,0 +1,372 @@ +package machines + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &MachineId{} + +func TestNewMachineID(t *testing.T) { + id := NewMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName", "machineName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.AgentPoolName != "agentPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolName") + } + + if id.MachineName != "machineName" { + t.Fatalf("Expected %q but got %q for Segment 'MachineName'", id.MachineName, "machineName") + } +} + +func TestFormatMachineID(t *testing.T) { + actual := NewMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName", "machineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines/machineName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseMachineID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MachineId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines/machineName", + Expected: &MachineId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", + MachineName: "machineName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines/machineName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMachineID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) + } + + if actual.MachineName != v.Expected.MachineName { + t.Fatalf("Expected %q but got %q for MachineName", v.Expected.MachineName, actual.MachineName) + } + + } +} + +func TestParseMachineIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MachineId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/mAcHiNeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines/machineName", + Expected: &MachineId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AgentPoolName: "agentPoolName", + MachineName: "machineName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/machines/machineName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/mAcHiNeS/mAcHiNeNaMe", + Expected: &MachineId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AgentPoolName: "aGeNtPoOlNaMe", + MachineName: "mAcHiNeNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/mAcHiNeS/mAcHiNeNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMachineIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AgentPoolName != v.Expected.AgentPoolName { + t.Fatalf("Expected %q but got %q for AgentPoolName", v.Expected.AgentPoolName, actual.AgentPoolName) + } + + if actual.MachineName != v.Expected.MachineName { + t.Fatalf("Expected %q but got %q for MachineName", v.Expected.MachineName, actual.MachineName) + } + + } +} + +func TestSegmentsForMachineId(t *testing.T) { + segments := MachineId{}.Segments() + if len(segments) == 0 { + t.Fatalf("MachineId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_get.go b/resource-manager/containerservice/2024-09-01/machines/method_get.go similarity index 74% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_get.go rename to resource-manager/containerservice/2024-09-01/machines/method_get.go index e5d7952b783..14636e392c1 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_get.go +++ b/resource-manager/containerservice/2024-09-01/machines/method_get.go @@ -1,8 +1,7 @@ -package sessionhostconfiguration +package machines import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -15,18 +14,18 @@ import ( type GetOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *SessionHostConfiguration + Model *Machine } // Get ... -func (c SessionHostConfigurationClient) Get(ctx context.Context, id HostPoolId) (result GetOperationResponse, err error) { +func (c MachinesClient) Get(ctx context.Context, id MachineId) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/sessionHostConfigurations/default", id.ID()), + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -44,7 +43,7 @@ func (c SessionHostConfigurationClient) Get(ctx context.Context, id HostPoolId) return } - var model SessionHostConfiguration + var model Machine result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/containerservice/2024-09-01/machines/method_list.go b/resource-manager/containerservice/2024-09-01/machines/method_list.go new file mode 100644 index 00000000000..949d16fc5e3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/method_list.go @@ -0,0 +1,105 @@ +package machines + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Machine +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Machine +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c MachinesClient) List(ctx context.Context, id AgentPoolId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/machines", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Machine `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c MachinesClient) ListComplete(ctx context.Context, id AgentPoolId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, MachineOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c MachinesClient) ListCompleteMatchingPredicate(ctx context.Context, id AgentPoolId, predicate MachineOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Machine, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/machines/model_machine.go b/resource-manager/containerservice/2024-09-01/machines/model_machine.go new file mode 100644 index 00000000000..33038791b72 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/model_machine.go @@ -0,0 +1,11 @@ +package machines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Machine struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MachineProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/machines/model_machineipaddress.go b/resource-manager/containerservice/2024-09-01/machines/model_machineipaddress.go new file mode 100644 index 00000000000..213cc86efcc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/model_machineipaddress.go @@ -0,0 +1,9 @@ +package machines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MachineIPAddress struct { + Family *IPFamily `json:"family,omitempty"` + IP *string `json:"ip,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/machines/model_machinenetworkproperties.go b/resource-manager/containerservice/2024-09-01/machines/model_machinenetworkproperties.go new file mode 100644 index 00000000000..5183ee2722f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/model_machinenetworkproperties.go @@ -0,0 +1,8 @@ +package machines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MachineNetworkProperties struct { + IPAddresses *[]MachineIPAddress `json:"ipAddresses,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/machines/model_machineproperties.go b/resource-manager/containerservice/2024-09-01/machines/model_machineproperties.go new file mode 100644 index 00000000000..041457c0e7c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/model_machineproperties.go @@ -0,0 +1,9 @@ +package machines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MachineProperties struct { + Network *MachineNetworkProperties `json:"network,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/predicates.go b/resource-manager/containerservice/2024-09-01/machines/predicates.go similarity index 71% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/predicates.go rename to resource-manager/containerservice/2024-09-01/machines/predicates.go index 834315d5ac9..ebc0babfdc2 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/predicates.go +++ b/resource-manager/containerservice/2024-09-01/machines/predicates.go @@ -1,15 +1,15 @@ -package sessionhostconfiguration +package machines // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SessionHostConfigurationOperationPredicate struct { +type MachineOperationPredicate struct { Id *string Name *string Type *string } -func (p SessionHostConfigurationOperationPredicate) Matches(input SessionHostConfiguration) bool { +func (p MachineOperationPredicate) Matches(input Machine) bool { if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { return false diff --git a/resource-manager/containerservice/2024-09-01/machines/version.go b/resource-manager/containerservice/2024-09-01/machines/version.go new file mode 100644 index 00000000000..6ac0c5337dd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/machines/version.go @@ -0,0 +1,10 @@ +package machines + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/machines/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/README.md b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/README.md new file mode 100644 index 00000000000..7d9e584ae90 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/README.md @@ -0,0 +1,91 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/maintenanceconfigurations` Documentation + +The `maintenanceconfigurations` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/maintenanceconfigurations" +``` + + +### Client Initialization + +```go +client := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `MaintenanceConfigurationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") + +payload := maintenanceconfigurations.MaintenanceConfiguration{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MaintenanceConfigurationsClient.Delete` + +```go +ctx := context.TODO() +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MaintenanceConfigurationsClient.Get` + +```go +ctx := context.TODO() +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MaintenanceConfigurationsClient.ListByManagedCluster` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +// alternatively `client.ListByManagedCluster(ctx, id)` can be used to do batched pagination +items, err := client.ListByManagedClusterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/client.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/client.go new file mode 100644 index 00000000000..bcb48de3779 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/client.go @@ -0,0 +1,26 @@ +package maintenanceconfigurations + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceConfigurationsClient struct { + Client *resourcemanager.Client +} + +func NewMaintenanceConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*MaintenanceConfigurationsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "maintenanceconfigurations", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating MaintenanceConfigurationsClient: %+v", err) + } + + return &MaintenanceConfigurationsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/constants.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/constants.go new file mode 100644 index 00000000000..2fdd49e9763 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/constants.go @@ -0,0 +1,116 @@ +package maintenanceconfigurations + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Type string + +const ( + TypeFirst Type = "First" + TypeFourth Type = "Fourth" + TypeLast Type = "Last" + TypeSecond Type = "Second" + TypeThird Type = "Third" +) + +func PossibleValuesForType() []string { + return []string{ + string(TypeFirst), + string(TypeFourth), + string(TypeLast), + string(TypeSecond), + string(TypeThird), + } +} + +func (s *Type) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseType(input string) (*Type, error) { + vals := map[string]Type{ + "first": TypeFirst, + "fourth": TypeFourth, + "last": TypeLast, + "second": TypeSecond, + "third": TypeThird, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Type(input) + return &out, nil +} + +type WeekDay string + +const ( + WeekDayFriday WeekDay = "Friday" + WeekDayMonday WeekDay = "Monday" + WeekDaySaturday WeekDay = "Saturday" + WeekDaySunday WeekDay = "Sunday" + WeekDayThursday WeekDay = "Thursday" + WeekDayTuesday WeekDay = "Tuesday" + WeekDayWednesday WeekDay = "Wednesday" +) + +func PossibleValuesForWeekDay() []string { + return []string{ + string(WeekDayFriday), + string(WeekDayMonday), + string(WeekDaySaturday), + string(WeekDaySunday), + string(WeekDayThursday), + string(WeekDayTuesday), + string(WeekDayWednesday), + } +} + +func (s *WeekDay) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWeekDay(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWeekDay(input string) (*WeekDay, error) { + vals := map[string]WeekDay{ + "friday": WeekDayFriday, + "monday": WeekDayMonday, + "saturday": WeekDaySaturday, + "sunday": WeekDaySunday, + "thursday": WeekDayThursday, + "tuesday": WeekDayTuesday, + "wednesday": WeekDayWednesday, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WeekDay(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration.go new file mode 100644 index 00000000000..a06e5519459 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration.go @@ -0,0 +1,139 @@ +package maintenanceconfigurations + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&MaintenanceConfigurationId{}) +} + +var _ resourceids.ResourceId = &MaintenanceConfigurationId{} + +// MaintenanceConfigurationId is a struct representing the Resource ID for a Maintenance Configuration +type MaintenanceConfigurationId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + MaintenanceConfigurationName string +} + +// NewMaintenanceConfigurationID returns a new MaintenanceConfigurationId struct +func NewMaintenanceConfigurationID(subscriptionId string, resourceGroupName string, managedClusterName string, maintenanceConfigurationName string) MaintenanceConfigurationId { + return MaintenanceConfigurationId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + MaintenanceConfigurationName: maintenanceConfigurationName, + } +} + +// ParseMaintenanceConfigurationID parses 'input' into a MaintenanceConfigurationId +func ParseMaintenanceConfigurationID(input string) (*MaintenanceConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(&MaintenanceConfigurationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MaintenanceConfigurationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseMaintenanceConfigurationIDInsensitively parses 'input' case-insensitively into a MaintenanceConfigurationId +// note: this method should only be used for API response data and not user input +func ParseMaintenanceConfigurationIDInsensitively(input string) (*MaintenanceConfigurationId, error) { + parser := resourceids.NewParserFromResourceIdType(&MaintenanceConfigurationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MaintenanceConfigurationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *MaintenanceConfigurationId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.MaintenanceConfigurationName, ok = input.Parsed["maintenanceConfigurationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "maintenanceConfigurationName", input) + } + + return nil +} + +// ValidateMaintenanceConfigurationID checks that 'input' can be parsed as a Maintenance Configuration ID +func ValidateMaintenanceConfigurationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMaintenanceConfigurationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Maintenance Configuration ID +func (id MaintenanceConfigurationId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/maintenanceConfigurations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.MaintenanceConfigurationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Maintenance Configuration ID +func (id MaintenanceConfigurationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), + resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationName"), + } +} + +// String returns a human-readable description of this Maintenance Configuration ID +func (id MaintenanceConfigurationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Maintenance Configuration Name: %q", id.MaintenanceConfigurationName), + } + return fmt.Sprintf("Maintenance Configuration (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go new file mode 100644 index 00000000000..d5d0ad17780 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go @@ -0,0 +1,327 @@ +package maintenanceconfigurations + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &MaintenanceConfigurationId{} + +func TestNewMaintenanceConfigurationID(t *testing.T) { + id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.MaintenanceConfigurationName != "maintenanceConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationName") + } +} + +func TestFormatMaintenanceConfigurationID(t *testing.T) { + actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseMaintenanceConfigurationID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MaintenanceConfigurationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", + Expected: &MaintenanceConfigurationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMaintenanceConfigurationID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.MaintenanceConfigurationName != v.Expected.MaintenanceConfigurationName { + t.Fatalf("Expected %q but got %q for MaintenanceConfigurationName", v.Expected.MaintenanceConfigurationName, actual.MaintenanceConfigurationName) + } + + } +} + +func TestParseMaintenanceConfigurationIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MaintenanceConfigurationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", + Expected: &MaintenanceConfigurationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE", + Expected: &MaintenanceConfigurationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNnAmE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMaintenanceConfigurationIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.MaintenanceConfigurationName != v.Expected.MaintenanceConfigurationName { + t.Fatalf("Expected %q but got %q for MaintenanceConfigurationName", v.Expected.MaintenanceConfigurationName, actual.MaintenanceConfigurationName) + } + + } +} + +func TestSegmentsForMaintenanceConfigurationId(t *testing.T) { + segments := MaintenanceConfigurationId{}.Segments() + if len(segments) == 0 { + t.Fatalf("MaintenanceConfigurationId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_createorupdate.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_createorupdate.go similarity index 74% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_createorupdate.go rename to resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_createorupdate.go index 0b03e0cdd6d..a6e8fc75722 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_createorupdate.go +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_createorupdate.go @@ -1,8 +1,7 @@ -package sessionhostmanagement +package maintenanceconfigurations import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -15,11 +14,11 @@ import ( type CreateOrUpdateOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *SessionHostManagement + Model *MaintenanceConfiguration } // CreateOrUpdate ... -func (c SessionHostManagementClient) CreateOrUpdate(ctx context.Context, id HostPoolId, input SessionHostManagement) (result CreateOrUpdateOperationResponse, err error) { +func (c MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, id MaintenanceConfigurationId, input MaintenanceConfiguration) (result CreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -27,7 +26,7 @@ func (c SessionHostManagementClient) CreateOrUpdate(ctx context.Context, id Host http.StatusOK, }, HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/sessionHostManagements/default", id.ID()), + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -49,7 +48,7 @@ func (c SessionHostManagementClient) CreateOrUpdate(ctx context.Context, id Host return } - var model SessionHostManagement + var model MaintenanceConfiguration result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_retryprovisioning.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_delete.go similarity index 69% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_retryprovisioning.go rename to resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_delete.go index d685a13a40a..5993be4c15a 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_retryprovisioning.go +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_delete.go @@ -1,8 +1,7 @@ -package sessionhost +package maintenanceconfigurations import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -12,20 +11,21 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type RetryProvisioningOperationResponse struct { +type DeleteOperationResponse struct { HttpResponse *http.Response OData *odata.OData } -// RetryProvisioning ... -func (c SessionHostClient) RetryProvisioning(ctx context.Context, id SessionHostId) (result RetryProvisioningOperationResponse, err error) { +// Delete ... +func (c MaintenanceConfigurationsClient) Delete(ctx context.Context, id MaintenanceConfigurationId) (result DeleteOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ + http.StatusNoContent, http.StatusOK, }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/retryProvisioning", id.ID()), + HttpMethod: http.MethodDelete, + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_get.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_get.go similarity index 72% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_get.go rename to resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_get.go index 8c4979b24d4..3989652ca96 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_get.go +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_get.go @@ -1,8 +1,7 @@ -package activesessionhostconfiguration +package maintenanceconfigurations import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -15,18 +14,18 @@ import ( type GetOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *ActiveSessionHostConfiguration + Model *MaintenanceConfiguration } // Get ... -func (c ActiveSessionHostConfigurationClient) Get(ctx context.Context, id HostPoolId) (result GetOperationResponse, err error) { +func (c MaintenanceConfigurationsClient) Get(ctx context.Context, id MaintenanceConfigurationId) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/activeSessionHostConfigurations/default", id.ID()), + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -44,7 +43,7 @@ func (c ActiveSessionHostConfigurationClient) Get(ctx context.Context, id HostPo return } - var model ActiveSessionHostConfiguration + var model MaintenanceConfiguration result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_listbymanagedcluster.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_listbymanagedcluster.go new file mode 100644 index 00000000000..f87e9032ed5 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/method_listbymanagedcluster.go @@ -0,0 +1,106 @@ +package maintenanceconfigurations + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByManagedClusterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]MaintenanceConfiguration +} + +type ListByManagedClusterCompleteResult struct { + LatestHttpResponse *http.Response + Items []MaintenanceConfiguration +} + +type ListByManagedClusterCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByManagedClusterCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByManagedCluster ... +func (c MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, id commonids.KubernetesClusterId) (result ListByManagedClusterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByManagedClusterCustomPager{}, + Path: fmt.Sprintf("%s/maintenanceConfigurations", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]MaintenanceConfiguration `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByManagedClusterComplete retrieves all the results into a single object +func (c MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListByManagedClusterCompleteResult, error) { + return c.ListByManagedClusterCompleteMatchingPredicate(ctx, id, MaintenanceConfigurationOperationPredicate{}) +} + +// ListByManagedClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c MaintenanceConfigurationsClient) ListByManagedClusterCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate MaintenanceConfigurationOperationPredicate) (result ListByManagedClusterCompleteResult, err error) { + items := make([]MaintenanceConfiguration, 0) + + resp, err := c.ListByManagedCluster(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByManagedClusterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_absolutemonthlyschedule.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_absolutemonthlyschedule.go new file mode 100644 index 00000000000..ca6966896ff --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_absolutemonthlyschedule.go @@ -0,0 +1,9 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AbsoluteMonthlySchedule struct { + DayOfMonth int64 `json:"dayOfMonth"` + IntervalMonths int64 `json:"intervalMonths"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_diskinfoproperties.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_dailyschedule.go similarity index 58% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_diskinfoproperties.go rename to resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_dailyschedule.go index 12a3356da0f..57fb3e994dd 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_diskinfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_dailyschedule.go @@ -1,8 +1,8 @@ -package activesessionhostconfiguration +package maintenanceconfigurations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DiskInfoProperties struct { - Type VirtualMachineDiskType `json:"type"` +type DailySchedule struct { + IntervalDays int64 `json:"intervalDays"` } diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_datespan.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_datespan.go new file mode 100644 index 00000000000..863c4704427 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_datespan.go @@ -0,0 +1,9 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DateSpan struct { + End string `json:"end"` + Start string `json:"start"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfiguration.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfiguration.go new file mode 100644 index 00000000000..9066e53bff3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfiguration.go @@ -0,0 +1,16 @@ +package maintenanceconfigurations + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceConfiguration struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MaintenanceConfigurationProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfigurationproperties.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfigurationproperties.go new file mode 100644 index 00000000000..d7c91bcf9f6 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenanceconfigurationproperties.go @@ -0,0 +1,10 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceConfigurationProperties struct { + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` + NotAllowedTime *[]TimeSpan `json:"notAllowedTime,omitempty"` + TimeInWeek *[]TimeInWeek `json:"timeInWeek,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenancewindow.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenancewindow.go new file mode 100644 index 00000000000..8f1a42f818c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_maintenancewindow.go @@ -0,0 +1,13 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceWindow struct { + DurationHours int64 `json:"durationHours"` + NotAllowedDates *[]DateSpan `json:"notAllowedDates,omitempty"` + Schedule Schedule `json:"schedule"` + StartDate *string `json:"startDate,omitempty"` + StartTime string `json:"startTime"` + UtcOffset *string `json:"utcOffset,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_relativemonthlyschedule.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_relativemonthlyschedule.go new file mode 100644 index 00000000000..0dfc104da98 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_relativemonthlyschedule.go @@ -0,0 +1,10 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RelativeMonthlySchedule struct { + DayOfWeek WeekDay `json:"dayOfWeek"` + IntervalMonths int64 `json:"intervalMonths"` + WeekIndex Type `json:"weekIndex"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_schedule.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_schedule.go new file mode 100644 index 00000000000..cc4397aba4c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_schedule.go @@ -0,0 +1,11 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Schedule struct { + AbsoluteMonthly *AbsoluteMonthlySchedule `json:"absoluteMonthly,omitempty"` + Daily *DailySchedule `json:"daily,omitempty"` + RelativeMonthly *RelativeMonthlySchedule `json:"relativeMonthly,omitempty"` + Weekly *WeeklySchedule `json:"weekly,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timeinweek.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timeinweek.go new file mode 100644 index 00000000000..cba259f76fc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timeinweek.go @@ -0,0 +1,9 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TimeInWeek struct { + Day *WeekDay `json:"day,omitempty"` + HourSlots *[]int64 `json:"hourSlots,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timespan.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timespan.go new file mode 100644 index 00000000000..7bbc8c5ba72 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_timespan.go @@ -0,0 +1,39 @@ +package maintenanceconfigurations + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TimeSpan struct { + End *string `json:"end,omitempty"` + Start *string `json:"start,omitempty"` +} + +func (o *TimeSpan) GetEndAsTime() (*time.Time, error) { + if o.End == nil { + return nil, nil + } + return dates.ParseAsFormat(o.End, "2006-01-02T15:04:05Z07:00") +} + +func (o *TimeSpan) SetEndAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.End = &formatted +} + +func (o *TimeSpan) GetStartAsTime() (*time.Time, error) { + if o.Start == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Start, "2006-01-02T15:04:05Z07:00") +} + +func (o *TimeSpan) SetStartAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Start = &formatted +} diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_weeklyschedule.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_weeklyschedule.go new file mode 100644 index 00000000000..ed775ad784e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/model_weeklyschedule.go @@ -0,0 +1,9 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WeeklySchedule struct { + DayOfWeek WeekDay `json:"dayOfWeek"` + IntervalWeeks int64 `json:"intervalWeeks"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/predicates.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/predicates.go similarity index 69% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/predicates.go rename to resource-manager/containerservice/2024-09-01/maintenanceconfigurations/predicates.go index 002e2f91724..c7eedb4fa7b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/predicates.go +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/predicates.go @@ -1,15 +1,15 @@ -package activesessionhostconfiguration +package maintenanceconfigurations // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ActiveSessionHostConfigurationOperationPredicate struct { +type MaintenanceConfigurationOperationPredicate struct { Id *string Name *string Type *string } -func (p ActiveSessionHostConfigurationOperationPredicate) Matches(input ActiveSessionHostConfiguration) bool { +func (p MaintenanceConfigurationOperationPredicate) Matches(input MaintenanceConfiguration) bool { if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { return false diff --git a/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/version.go b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/version.go new file mode 100644 index 00000000000..05214ac04cb --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/maintenanceconfigurations/version.go @@ -0,0 +1,10 @@ +package maintenanceconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/maintenanceconfigurations/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/README.md b/resource-manager/containerservice/2024-09-01/managedclusters/README.md new file mode 100644 index 00000000000..a7e98c27997 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/README.md @@ -0,0 +1,423 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/managedclusters` Documentation + +The `managedclusters` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/managedclusters" +``` + + +### Client Initialization + +```go +client := managedclusters.NewManagedClustersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ManagedClustersClient.AbortLatestOperation` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := managedclusters.ManagedCluster{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload, managedclusters.DefaultCreateOrUpdateOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.DeleteThenPoll(ctx, id, managedclusters.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.GetAccessProfile` + +```go +ctx := context.TODO() +id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") + +read, err := client.GetAccessProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.GetCommandResult` + +```go +ctx := context.TODO() +id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") + +read, err := client.GetCommandResult(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.GetMeshRevisionProfile` + +```go +ctx := context.TODO() +id := managedclusters.NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName") + +read, err := client.GetMeshRevisionProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.GetMeshUpgradeProfile` + +```go +ctx := context.TODO() +id := managedclusters.NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName") + +read, err := client.GetMeshUpgradeProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.GetUpgradeProfile` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.GetUpgradeProfile(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.List` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ManagedClustersClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ManagedClustersClient.ListClusterAdminCredentials` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.ListClusterAdminCredentials(ctx, id, managedclusters.DefaultListClusterAdminCredentialsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.ListClusterMonitoringUserCredentials` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.ListClusterMonitoringUserCredentials(ctx, id, managedclusters.DefaultListClusterMonitoringUserCredentialsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.ListClusterUserCredentials` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.ListClusterUserCredentials(ctx, id, managedclusters.DefaultListClusterUserCredentialsOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.ListKubernetesVersions` + +```go +ctx := context.TODO() +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +read, err := client.ListKubernetesVersions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ManagedClustersClient.ListMeshRevisionProfiles` + +```go +ctx := context.TODO() +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListMeshRevisionProfiles(ctx, id)` can be used to do batched pagination +items, err := client.ListMeshRevisionProfilesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ManagedClustersClient.ListMeshUpgradeProfiles` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +// alternatively `client.ListMeshUpgradeProfiles(ctx, id)` can be used to do batched pagination +items, err := client.ListMeshUpgradeProfilesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +// alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination +items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ManagedClustersClient.ResetAADProfile` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := managedclusters.ManagedClusterAADProfile{ + // ... +} + + +if err := client.ResetAADProfileThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.ResetServicePrincipalProfile` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := managedclusters.ManagedClusterServicePrincipalProfile{ + // ... +} + + +if err := client.ResetServicePrincipalProfileThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.RotateClusterCertificates` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.RotateClusterCertificatesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.RotateServiceAccountSigningKeys` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.RotateServiceAccountSigningKeysThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.RunCommand` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := managedclusters.RunCommandRequest{ + // ... +} + + +if err := client.RunCommandThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.Start` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.Stop` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +if err := client.StopThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ManagedClustersClient.UpdateTags` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := managedclusters.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload, managedclusters.DefaultUpdateTagsOperationOptions()); err != nil { + // handle the error +} +``` diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/client.go b/resource-manager/containerservice/2024-09-01/managedclusters/client.go new file mode 100644 index 00000000000..a2037a7e28b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/client.go @@ -0,0 +1,26 @@ +package managedclusters + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClustersClient struct { + Client *resourcemanager.Client +} + +func NewManagedClustersClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedClustersClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "managedclusters", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ManagedClustersClient: %+v", err) + } + + return &ManagedClustersClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/constants.go b/resource-manager/containerservice/2024-09-01/managedclusters/constants.go new file mode 100644 index 00000000000..1fd7ea02148 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/constants.go @@ -0,0 +1,1549 @@ +package managedclusters + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolMode string + +const ( + AgentPoolModeSystem AgentPoolMode = "System" + AgentPoolModeUser AgentPoolMode = "User" +) + +func PossibleValuesForAgentPoolMode() []string { + return []string{ + string(AgentPoolModeSystem), + string(AgentPoolModeUser), + } +} + +func (s *AgentPoolMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAgentPoolMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAgentPoolMode(input string) (*AgentPoolMode, error) { + vals := map[string]AgentPoolMode{ + "system": AgentPoolModeSystem, + "user": AgentPoolModeUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AgentPoolMode(input) + return &out, nil +} + +type AgentPoolType string + +const ( + AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet" + AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +func PossibleValuesForAgentPoolType() []string { + return []string{ + string(AgentPoolTypeAvailabilitySet), + string(AgentPoolTypeVirtualMachineScaleSets), + } +} + +func (s *AgentPoolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAgentPoolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAgentPoolType(input string) (*AgentPoolType, error) { + vals := map[string]AgentPoolType{ + "availabilityset": AgentPoolTypeAvailabilitySet, + "virtualmachinescalesets": AgentPoolTypeVirtualMachineScaleSets, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AgentPoolType(input) + return &out, nil +} + +type BackendPoolType string + +const ( + BackendPoolTypeNodeIP BackendPoolType = "NodeIP" + BackendPoolTypeNodeIPConfiguration BackendPoolType = "NodeIPConfiguration" +) + +func PossibleValuesForBackendPoolType() []string { + return []string{ + string(BackendPoolTypeNodeIP), + string(BackendPoolTypeNodeIPConfiguration), + } +} + +func (s *BackendPoolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackendPoolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackendPoolType(input string) (*BackendPoolType, error) { + vals := map[string]BackendPoolType{ + "nodeip": BackendPoolTypeNodeIP, + "nodeipconfiguration": BackendPoolTypeNodeIPConfiguration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackendPoolType(input) + return &out, nil +} + +type Code string + +const ( + CodeRunning Code = "Running" + CodeStopped Code = "Stopped" +) + +func PossibleValuesForCode() []string { + return []string{ + string(CodeRunning), + string(CodeStopped), + } +} + +func (s *Code) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCode(input string) (*Code, error) { + vals := map[string]Code{ + "running": CodeRunning, + "stopped": CodeStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Code(input) + return &out, nil +} + +type Expander string + +const ( + ExpanderLeastNegativewaste Expander = "least-waste" + ExpanderMostNegativepods Expander = "most-pods" + ExpanderPriority Expander = "priority" + ExpanderRandom Expander = "random" +) + +func PossibleValuesForExpander() []string { + return []string{ + string(ExpanderLeastNegativewaste), + string(ExpanderMostNegativepods), + string(ExpanderPriority), + string(ExpanderRandom), + } +} + +func (s *Expander) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseExpander(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseExpander(input string) (*Expander, error) { + vals := map[string]Expander{ + "least-waste": ExpanderLeastNegativewaste, + "most-pods": ExpanderMostNegativepods, + "priority": ExpanderPriority, + "random": ExpanderRandom, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Expander(input) + return &out, nil +} + +type Format string + +const ( + FormatAzure Format = "azure" + FormatExec Format = "exec" +) + +func PossibleValuesForFormat() []string { + return []string{ + string(FormatAzure), + string(FormatExec), + } +} + +func (s *Format) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFormat(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFormat(input string) (*Format, error) { + vals := map[string]Format{ + "azure": FormatAzure, + "exec": FormatExec, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Format(input) + return &out, nil +} + +type GPUInstanceProfile string + +const ( + GPUInstanceProfileMIGFourg GPUInstanceProfile = "MIG4g" + GPUInstanceProfileMIGOneg GPUInstanceProfile = "MIG1g" + GPUInstanceProfileMIGSeveng GPUInstanceProfile = "MIG7g" + GPUInstanceProfileMIGThreeg GPUInstanceProfile = "MIG3g" + GPUInstanceProfileMIGTwog GPUInstanceProfile = "MIG2g" +) + +func PossibleValuesForGPUInstanceProfile() []string { + return []string{ + string(GPUInstanceProfileMIGFourg), + string(GPUInstanceProfileMIGOneg), + string(GPUInstanceProfileMIGSeveng), + string(GPUInstanceProfileMIGThreeg), + string(GPUInstanceProfileMIGTwog), + } +} + +func (s *GPUInstanceProfile) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGPUInstanceProfile(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGPUInstanceProfile(input string) (*GPUInstanceProfile, error) { + vals := map[string]GPUInstanceProfile{ + "mig4g": GPUInstanceProfileMIGFourg, + "mig1g": GPUInstanceProfileMIGOneg, + "mig7g": GPUInstanceProfileMIGSeveng, + "mig3g": GPUInstanceProfileMIGThreeg, + "mig2g": GPUInstanceProfileMIGTwog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GPUInstanceProfile(input) + return &out, nil +} + +type IPFamily string + +const ( + IPFamilyIPvFour IPFamily = "IPv4" + IPFamilyIPvSix IPFamily = "IPv6" +) + +func PossibleValuesForIPFamily() []string { + return []string{ + string(IPFamilyIPvFour), + string(IPFamilyIPvSix), + } +} + +func (s *IPFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPFamily(input string) (*IPFamily, error) { + vals := map[string]IPFamily{ + "ipv4": IPFamilyIPvFour, + "ipv6": IPFamilyIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPFamily(input) + return &out, nil +} + +type IstioIngressGatewayMode string + +const ( + IstioIngressGatewayModeExternal IstioIngressGatewayMode = "External" + IstioIngressGatewayModeInternal IstioIngressGatewayMode = "Internal" +) + +func PossibleValuesForIstioIngressGatewayMode() []string { + return []string{ + string(IstioIngressGatewayModeExternal), + string(IstioIngressGatewayModeInternal), + } +} + +func (s *IstioIngressGatewayMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIstioIngressGatewayMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIstioIngressGatewayMode(input string) (*IstioIngressGatewayMode, error) { + vals := map[string]IstioIngressGatewayMode{ + "external": IstioIngressGatewayModeExternal, + "internal": IstioIngressGatewayModeInternal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IstioIngressGatewayMode(input) + return &out, nil +} + +type KeyVaultNetworkAccessTypes string + +const ( + KeyVaultNetworkAccessTypesPrivate KeyVaultNetworkAccessTypes = "Private" + KeyVaultNetworkAccessTypesPublic KeyVaultNetworkAccessTypes = "Public" +) + +func PossibleValuesForKeyVaultNetworkAccessTypes() []string { + return []string{ + string(KeyVaultNetworkAccessTypesPrivate), + string(KeyVaultNetworkAccessTypesPublic), + } +} + +func (s *KeyVaultNetworkAccessTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKeyVaultNetworkAccessTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKeyVaultNetworkAccessTypes(input string) (*KeyVaultNetworkAccessTypes, error) { + vals := map[string]KeyVaultNetworkAccessTypes{ + "private": KeyVaultNetworkAccessTypesPrivate, + "public": KeyVaultNetworkAccessTypesPublic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyVaultNetworkAccessTypes(input) + return &out, nil +} + +type KubeletDiskType string + +const ( + KubeletDiskTypeOS KubeletDiskType = "OS" + KubeletDiskTypeTemporary KubeletDiskType = "Temporary" +) + +func PossibleValuesForKubeletDiskType() []string { + return []string{ + string(KubeletDiskTypeOS), + string(KubeletDiskTypeTemporary), + } +} + +func (s *KubeletDiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKubeletDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKubeletDiskType(input string) (*KubeletDiskType, error) { + vals := map[string]KubeletDiskType{ + "os": KubeletDiskTypeOS, + "temporary": KubeletDiskTypeTemporary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KubeletDiskType(input) + return &out, nil +} + +type KubernetesSupportPlan string + +const ( + KubernetesSupportPlanAKSLongTermSupport KubernetesSupportPlan = "AKSLongTermSupport" + KubernetesSupportPlanKubernetesOfficial KubernetesSupportPlan = "KubernetesOfficial" +) + +func PossibleValuesForKubernetesSupportPlan() []string { + return []string{ + string(KubernetesSupportPlanAKSLongTermSupport), + string(KubernetesSupportPlanKubernetesOfficial), + } +} + +func (s *KubernetesSupportPlan) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKubernetesSupportPlan(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKubernetesSupportPlan(input string) (*KubernetesSupportPlan, error) { + vals := map[string]KubernetesSupportPlan{ + "akslongtermsupport": KubernetesSupportPlanAKSLongTermSupport, + "kubernetesofficial": KubernetesSupportPlanKubernetesOfficial, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KubernetesSupportPlan(input) + return &out, nil +} + +type LicenseType string + +const ( + LicenseTypeNone LicenseType = "None" + LicenseTypeWindowsServer LicenseType = "Windows_Server" +) + +func PossibleValuesForLicenseType() []string { + return []string{ + string(LicenseTypeNone), + string(LicenseTypeWindowsServer), + } +} + +func (s *LicenseType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLicenseType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLicenseType(input string) (*LicenseType, error) { + vals := map[string]LicenseType{ + "none": LicenseTypeNone, + "windows_server": LicenseTypeWindowsServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LicenseType(input) + return &out, nil +} + +type LoadBalancerSku string + +const ( + LoadBalancerSkuBasic LoadBalancerSku = "basic" + LoadBalancerSkuStandard LoadBalancerSku = "standard" +) + +func PossibleValuesForLoadBalancerSku() []string { + return []string{ + string(LoadBalancerSkuBasic), + string(LoadBalancerSkuStandard), + } +} + +func (s *LoadBalancerSku) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerSku(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerSku(input string) (*LoadBalancerSku, error) { + vals := map[string]LoadBalancerSku{ + "basic": LoadBalancerSkuBasic, + "standard": LoadBalancerSkuStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerSku(input) + return &out, nil +} + +type ManagedClusterPodIdentityProvisioningState string + +const ( + ManagedClusterPodIdentityProvisioningStateAssigned ManagedClusterPodIdentityProvisioningState = "Assigned" + ManagedClusterPodIdentityProvisioningStateCanceled ManagedClusterPodIdentityProvisioningState = "Canceled" + ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting" + ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed" + ManagedClusterPodIdentityProvisioningStateSucceeded ManagedClusterPodIdentityProvisioningState = "Succeeded" + ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating" +) + +func PossibleValuesForManagedClusterPodIdentityProvisioningState() []string { + return []string{ + string(ManagedClusterPodIdentityProvisioningStateAssigned), + string(ManagedClusterPodIdentityProvisioningStateCanceled), + string(ManagedClusterPodIdentityProvisioningStateDeleting), + string(ManagedClusterPodIdentityProvisioningStateFailed), + string(ManagedClusterPodIdentityProvisioningStateSucceeded), + string(ManagedClusterPodIdentityProvisioningStateUpdating), + } +} + +func (s *ManagedClusterPodIdentityProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedClusterPodIdentityProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedClusterPodIdentityProvisioningState(input string) (*ManagedClusterPodIdentityProvisioningState, error) { + vals := map[string]ManagedClusterPodIdentityProvisioningState{ + "assigned": ManagedClusterPodIdentityProvisioningStateAssigned, + "canceled": ManagedClusterPodIdentityProvisioningStateCanceled, + "deleting": ManagedClusterPodIdentityProvisioningStateDeleting, + "failed": ManagedClusterPodIdentityProvisioningStateFailed, + "succeeded": ManagedClusterPodIdentityProvisioningStateSucceeded, + "updating": ManagedClusterPodIdentityProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedClusterPodIdentityProvisioningState(input) + return &out, nil +} + +type ManagedClusterSKUName string + +const ( + ManagedClusterSKUNameBase ManagedClusterSKUName = "Base" +) + +func PossibleValuesForManagedClusterSKUName() []string { + return []string{ + string(ManagedClusterSKUNameBase), + } +} + +func (s *ManagedClusterSKUName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedClusterSKUName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedClusterSKUName(input string) (*ManagedClusterSKUName, error) { + vals := map[string]ManagedClusterSKUName{ + "base": ManagedClusterSKUNameBase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedClusterSKUName(input) + return &out, nil +} + +type ManagedClusterSKUTier string + +const ( + ManagedClusterSKUTierFree ManagedClusterSKUTier = "Free" + ManagedClusterSKUTierPremium ManagedClusterSKUTier = "Premium" + ManagedClusterSKUTierStandard ManagedClusterSKUTier = "Standard" +) + +func PossibleValuesForManagedClusterSKUTier() []string { + return []string{ + string(ManagedClusterSKUTierFree), + string(ManagedClusterSKUTierPremium), + string(ManagedClusterSKUTierStandard), + } +} + +func (s *ManagedClusterSKUTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedClusterSKUTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedClusterSKUTier(input string) (*ManagedClusterSKUTier, error) { + vals := map[string]ManagedClusterSKUTier{ + "free": ManagedClusterSKUTierFree, + "premium": ManagedClusterSKUTierPremium, + "standard": ManagedClusterSKUTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedClusterSKUTier(input) + return &out, nil +} + +type NetworkDataplane string + +const ( + NetworkDataplaneAzure NetworkDataplane = "azure" + NetworkDataplaneCilium NetworkDataplane = "cilium" +) + +func PossibleValuesForNetworkDataplane() []string { + return []string{ + string(NetworkDataplaneAzure), + string(NetworkDataplaneCilium), + } +} + +func (s *NetworkDataplane) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkDataplane(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkDataplane(input string) (*NetworkDataplane, error) { + vals := map[string]NetworkDataplane{ + "azure": NetworkDataplaneAzure, + "cilium": NetworkDataplaneCilium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkDataplane(input) + return &out, nil +} + +type NetworkMode string + +const ( + NetworkModeBridge NetworkMode = "bridge" + NetworkModeTransparent NetworkMode = "transparent" +) + +func PossibleValuesForNetworkMode() []string { + return []string{ + string(NetworkModeBridge), + string(NetworkModeTransparent), + } +} + +func (s *NetworkMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkMode(input string) (*NetworkMode, error) { + vals := map[string]NetworkMode{ + "bridge": NetworkModeBridge, + "transparent": NetworkModeTransparent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkMode(input) + return &out, nil +} + +type NetworkPlugin string + +const ( + NetworkPluginAzure NetworkPlugin = "azure" + NetworkPluginKubenet NetworkPlugin = "kubenet" + NetworkPluginNone NetworkPlugin = "none" +) + +func PossibleValuesForNetworkPlugin() []string { + return []string{ + string(NetworkPluginAzure), + string(NetworkPluginKubenet), + string(NetworkPluginNone), + } +} + +func (s *NetworkPlugin) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkPlugin(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkPlugin(input string) (*NetworkPlugin, error) { + vals := map[string]NetworkPlugin{ + "azure": NetworkPluginAzure, + "kubenet": NetworkPluginKubenet, + "none": NetworkPluginNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkPlugin(input) + return &out, nil +} + +type NetworkPluginMode string + +const ( + NetworkPluginModeOverlay NetworkPluginMode = "overlay" +) + +func PossibleValuesForNetworkPluginMode() []string { + return []string{ + string(NetworkPluginModeOverlay), + } +} + +func (s *NetworkPluginMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkPluginMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkPluginMode(input string) (*NetworkPluginMode, error) { + vals := map[string]NetworkPluginMode{ + "overlay": NetworkPluginModeOverlay, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkPluginMode(input) + return &out, nil +} + +type NetworkPolicy string + +const ( + NetworkPolicyAzure NetworkPolicy = "azure" + NetworkPolicyCalico NetworkPolicy = "calico" + NetworkPolicyCilium NetworkPolicy = "cilium" + NetworkPolicyNone NetworkPolicy = "none" +) + +func PossibleValuesForNetworkPolicy() []string { + return []string{ + string(NetworkPolicyAzure), + string(NetworkPolicyCalico), + string(NetworkPolicyCilium), + string(NetworkPolicyNone), + } +} + +func (s *NetworkPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkPolicy(input string) (*NetworkPolicy, error) { + vals := map[string]NetworkPolicy{ + "azure": NetworkPolicyAzure, + "calico": NetworkPolicyCalico, + "cilium": NetworkPolicyCilium, + "none": NetworkPolicyNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkPolicy(input) + return &out, nil +} + +type NodeOSUpgradeChannel string + +const ( + NodeOSUpgradeChannelNodeImage NodeOSUpgradeChannel = "NodeImage" + NodeOSUpgradeChannelNone NodeOSUpgradeChannel = "None" + NodeOSUpgradeChannelSecurityPatch NodeOSUpgradeChannel = "SecurityPatch" + NodeOSUpgradeChannelUnmanaged NodeOSUpgradeChannel = "Unmanaged" +) + +func PossibleValuesForNodeOSUpgradeChannel() []string { + return []string{ + string(NodeOSUpgradeChannelNodeImage), + string(NodeOSUpgradeChannelNone), + string(NodeOSUpgradeChannelSecurityPatch), + string(NodeOSUpgradeChannelUnmanaged), + } +} + +func (s *NodeOSUpgradeChannel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNodeOSUpgradeChannel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNodeOSUpgradeChannel(input string) (*NodeOSUpgradeChannel, error) { + vals := map[string]NodeOSUpgradeChannel{ + "nodeimage": NodeOSUpgradeChannelNodeImage, + "none": NodeOSUpgradeChannelNone, + "securitypatch": NodeOSUpgradeChannelSecurityPatch, + "unmanaged": NodeOSUpgradeChannelUnmanaged, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NodeOSUpgradeChannel(input) + return &out, nil +} + +type OSDiskType string + +const ( + OSDiskTypeEphemeral OSDiskType = "Ephemeral" + OSDiskTypeManaged OSDiskType = "Managed" +) + +func PossibleValuesForOSDiskType() []string { + return []string{ + string(OSDiskTypeEphemeral), + string(OSDiskTypeManaged), + } +} + +func (s *OSDiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSDiskType(input string) (*OSDiskType, error) { + vals := map[string]OSDiskType{ + "ephemeral": OSDiskTypeEphemeral, + "managed": OSDiskTypeManaged, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSDiskType(input) + return &out, nil +} + +type OSSKU string + +const ( + OSSKUAzureLinux OSSKU = "AzureLinux" + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUUbuntu OSSKU = "Ubuntu" + OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" + OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" +) + +func PossibleValuesForOSSKU() []string { + return []string{ + string(OSSKUAzureLinux), + string(OSSKUCBLMariner), + string(OSSKUUbuntu), + string(OSSKUWindowsTwoZeroOneNine), + string(OSSKUWindowsTwoZeroTwoTwo), + } +} + +func (s *OSSKU) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSSKU(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSSKU(input string) (*OSSKU, error) { + vals := map[string]OSSKU{ + "azurelinux": OSSKUAzureLinux, + "cblmariner": OSSKUCBLMariner, + "ubuntu": OSSKUUbuntu, + "windows2019": OSSKUWindowsTwoZeroOneNine, + "windows2022": OSSKUWindowsTwoZeroTwoTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSSKU(input) + return &out, nil +} + +type OSType string + +const ( + OSTypeLinux OSType = "Linux" + OSTypeWindows OSType = "Windows" +) + +func PossibleValuesForOSType() []string { + return []string{ + string(OSTypeLinux), + string(OSTypeWindows), + } +} + +func (s *OSType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSType(input string) (*OSType, error) { + vals := map[string]OSType{ + "linux": OSTypeLinux, + "windows": OSTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSType(input) + return &out, nil +} + +type OutboundType string + +const ( + OutboundTypeLoadBalancer OutboundType = "loadBalancer" + OutboundTypeManagedNATGateway OutboundType = "managedNATGateway" + OutboundTypeUserAssignedNATGateway OutboundType = "userAssignedNATGateway" + OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting" +) + +func PossibleValuesForOutboundType() []string { + return []string{ + string(OutboundTypeLoadBalancer), + string(OutboundTypeManagedNATGateway), + string(OutboundTypeUserAssignedNATGateway), + string(OutboundTypeUserDefinedRouting), + } +} + +func (s *OutboundType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOutboundType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOutboundType(input string) (*OutboundType, error) { + vals := map[string]OutboundType{ + "loadbalancer": OutboundTypeLoadBalancer, + "managednatgateway": OutboundTypeManagedNATGateway, + "userassignednatgateway": OutboundTypeUserAssignedNATGateway, + "userdefinedrouting": OutboundTypeUserDefinedRouting, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OutboundType(input) + return &out, nil +} + +type Protocol string + +const ( + ProtocolTCP Protocol = "TCP" + ProtocolUDP Protocol = "UDP" +) + +func PossibleValuesForProtocol() []string { + return []string{ + string(ProtocolTCP), + string(ProtocolUDP), + } +} + +func (s *Protocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocol(input string) (*Protocol, error) { + vals := map[string]Protocol{ + "tcp": ProtocolTCP, + "udp": ProtocolUDP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Protocol(input) + return &out, nil +} + +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +func PossibleValuesForPublicNetworkAccess() []string { + return []string{ + string(PublicNetworkAccessDisabled), + string(PublicNetworkAccessEnabled), + } +} + +func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicNetworkAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { + vals := map[string]PublicNetworkAccess{ + "disabled": PublicNetworkAccessDisabled, + "enabled": PublicNetworkAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccess(input) + return &out, nil +} + +type RestrictionLevel string + +const ( + RestrictionLevelReadOnly RestrictionLevel = "ReadOnly" + RestrictionLevelUnrestricted RestrictionLevel = "Unrestricted" +) + +func PossibleValuesForRestrictionLevel() []string { + return []string{ + string(RestrictionLevelReadOnly), + string(RestrictionLevelUnrestricted), + } +} + +func (s *RestrictionLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestrictionLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestrictionLevel(input string) (*RestrictionLevel, error) { + vals := map[string]RestrictionLevel{ + "readonly": RestrictionLevelReadOnly, + "unrestricted": RestrictionLevelUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestrictionLevel(input) + return &out, nil +} + +type ScaleDownMode string + +const ( + ScaleDownModeDeallocate ScaleDownMode = "Deallocate" + ScaleDownModeDelete ScaleDownMode = "Delete" +) + +func PossibleValuesForScaleDownMode() []string { + return []string{ + string(ScaleDownModeDeallocate), + string(ScaleDownModeDelete), + } +} + +func (s *ScaleDownMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleDownMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleDownMode(input string) (*ScaleDownMode, error) { + vals := map[string]ScaleDownMode{ + "deallocate": ScaleDownModeDeallocate, + "delete": ScaleDownModeDelete, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleDownMode(input) + return &out, nil +} + +type ScaleSetEvictionPolicy string + +const ( + ScaleSetEvictionPolicyDeallocate ScaleSetEvictionPolicy = "Deallocate" + ScaleSetEvictionPolicyDelete ScaleSetEvictionPolicy = "Delete" +) + +func PossibleValuesForScaleSetEvictionPolicy() []string { + return []string{ + string(ScaleSetEvictionPolicyDeallocate), + string(ScaleSetEvictionPolicyDelete), + } +} + +func (s *ScaleSetEvictionPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleSetEvictionPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleSetEvictionPolicy(input string) (*ScaleSetEvictionPolicy, error) { + vals := map[string]ScaleSetEvictionPolicy{ + "deallocate": ScaleSetEvictionPolicyDeallocate, + "delete": ScaleSetEvictionPolicyDelete, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleSetEvictionPolicy(input) + return &out, nil +} + +type ScaleSetPriority string + +const ( + ScaleSetPriorityRegular ScaleSetPriority = "Regular" + ScaleSetPrioritySpot ScaleSetPriority = "Spot" +) + +func PossibleValuesForScaleSetPriority() []string { + return []string{ + string(ScaleSetPriorityRegular), + string(ScaleSetPrioritySpot), + } +} + +func (s *ScaleSetPriority) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleSetPriority(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleSetPriority(input string) (*ScaleSetPriority, error) { + vals := map[string]ScaleSetPriority{ + "regular": ScaleSetPriorityRegular, + "spot": ScaleSetPrioritySpot, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleSetPriority(input) + return &out, nil +} + +type ServiceMeshMode string + +const ( + ServiceMeshModeDisabled ServiceMeshMode = "Disabled" + ServiceMeshModeIstio ServiceMeshMode = "Istio" +) + +func PossibleValuesForServiceMeshMode() []string { + return []string{ + string(ServiceMeshModeDisabled), + string(ServiceMeshModeIstio), + } +} + +func (s *ServiceMeshMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceMeshMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceMeshMode(input string) (*ServiceMeshMode, error) { + vals := map[string]ServiceMeshMode{ + "disabled": ServiceMeshModeDisabled, + "istio": ServiceMeshModeIstio, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceMeshMode(input) + return &out, nil +} + +type UpgradeChannel string + +const ( + UpgradeChannelNodeNegativeimage UpgradeChannel = "node-image" + UpgradeChannelNone UpgradeChannel = "none" + UpgradeChannelPatch UpgradeChannel = "patch" + UpgradeChannelRapid UpgradeChannel = "rapid" + UpgradeChannelStable UpgradeChannel = "stable" +) + +func PossibleValuesForUpgradeChannel() []string { + return []string{ + string(UpgradeChannelNodeNegativeimage), + string(UpgradeChannelNone), + string(UpgradeChannelPatch), + string(UpgradeChannelRapid), + string(UpgradeChannelStable), + } +} + +func (s *UpgradeChannel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpgradeChannel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpgradeChannel(input string) (*UpgradeChannel, error) { + vals := map[string]UpgradeChannel{ + "node-image": UpgradeChannelNodeNegativeimage, + "none": UpgradeChannelNone, + "patch": UpgradeChannelPatch, + "rapid": UpgradeChannelRapid, + "stable": UpgradeChannelStable, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpgradeChannel(input) + return &out, nil +} + +type WorkloadRuntime string + +const ( + WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" + WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" +) + +func PossibleValuesForWorkloadRuntime() []string { + return []string{ + string(WorkloadRuntimeOCIContainer), + string(WorkloadRuntimeWasmWasi), + } +} + +func (s *WorkloadRuntime) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWorkloadRuntime(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWorkloadRuntime(input string) (*WorkloadRuntime, error) { + vals := map[string]WorkloadRuntime{ + "ocicontainer": WorkloadRuntimeOCIContainer, + "wasmwasi": WorkloadRuntimeWasmWasi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WorkloadRuntime(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile.go new file mode 100644 index 00000000000..0cc903a7fde --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile.go @@ -0,0 +1,139 @@ +package managedclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&AccessProfileId{}) +} + +var _ resourceids.ResourceId = &AccessProfileId{} + +// AccessProfileId is a struct representing the Resource ID for a Access Profile +type AccessProfileId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + AccessProfileName string +} + +// NewAccessProfileID returns a new AccessProfileId struct +func NewAccessProfileID(subscriptionId string, resourceGroupName string, managedClusterName string, accessProfileName string) AccessProfileId { + return AccessProfileId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + AccessProfileName: accessProfileName, + } +} + +// ParseAccessProfileID parses 'input' into a AccessProfileId +func ParseAccessProfileID(input string) (*AccessProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&AccessProfileId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AccessProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAccessProfileIDInsensitively parses 'input' case-insensitively into a AccessProfileId +// note: this method should only be used for API response data and not user input +func ParseAccessProfileIDInsensitively(input string) (*AccessProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&AccessProfileId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AccessProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AccessProfileId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.AccessProfileName, ok = input.Parsed["accessProfileName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "accessProfileName", input) + } + + return nil +} + +// ValidateAccessProfileID checks that 'input' can be parsed as a Access Profile ID +func ValidateAccessProfileID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseAccessProfileID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Access Profile ID +func (id AccessProfileId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/accessProfiles/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.AccessProfileName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Access Profile ID +func (id AccessProfileId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), + resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileName"), + } +} + +// String returns a human-readable description of this Access Profile ID +func (id AccessProfileId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Access Profile Name: %q", id.AccessProfileName), + } + return fmt.Sprintf("Access Profile (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile_test.go new file mode 100644 index 00000000000..9d2f96670dd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_accessprofile_test.go @@ -0,0 +1,327 @@ +package managedclusters + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &AccessProfileId{} + +func TestNewAccessProfileID(t *testing.T) { + id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.AccessProfileName != "accessProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileName") + } +} + +func TestFormatAccessProfileID(t *testing.T) { + actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseAccessProfileID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AccessProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", + Expected: &AccessProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAccessProfileID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AccessProfileName != v.Expected.AccessProfileName { + t.Fatalf("Expected %q but got %q for AccessProfileName", v.Expected.AccessProfileName, actual.AccessProfileName) + } + + } +} + +func TestParseAccessProfileIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AccessProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", + Expected: &AccessProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe", + Expected: &AccessProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AccessProfileName: "aCcEsSpRoFiLeNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAccessProfileIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.AccessProfileName != v.Expected.AccessProfileName { + t.Fatalf("Expected %q but got %q for AccessProfileName", v.Expected.AccessProfileName, actual.AccessProfileName) + } + + } +} + +func TestSegmentsForAccessProfileId(t *testing.T) { + segments := AccessProfileId{}.Segments() + if len(segments) == 0 { + t.Fatalf("AccessProfileId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult.go new file mode 100644 index 00000000000..737a71e0621 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult.go @@ -0,0 +1,139 @@ +package managedclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&CommandResultId{}) +} + +var _ resourceids.ResourceId = &CommandResultId{} + +// CommandResultId is a struct representing the Resource ID for a Command Result +type CommandResultId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + CommandId string +} + +// NewCommandResultID returns a new CommandResultId struct +func NewCommandResultID(subscriptionId string, resourceGroupName string, managedClusterName string, commandId string) CommandResultId { + return CommandResultId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + CommandId: commandId, + } +} + +// ParseCommandResultID parses 'input' into a CommandResultId +func ParseCommandResultID(input string) (*CommandResultId, error) { + parser := resourceids.NewParserFromResourceIdType(&CommandResultId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CommandResultId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCommandResultIDInsensitively parses 'input' case-insensitively into a CommandResultId +// note: this method should only be used for API response data and not user input +func ParseCommandResultIDInsensitively(input string) (*CommandResultId, error) { + parser := resourceids.NewParserFromResourceIdType(&CommandResultId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CommandResultId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CommandResultId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.CommandId, ok = input.Parsed["commandId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "commandId", input) + } + + return nil +} + +// ValidateCommandResultID checks that 'input' can be parsed as a Command Result ID +func ValidateCommandResultID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCommandResultID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Command Result ID +func (id CommandResultId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/commandResults/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.CommandId) +} + +// Segments returns a slice of Resource ID Segments which comprise this Command Result ID +func (id CommandResultId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), + resourceids.UserSpecifiedSegment("commandId", "commandId"), + } +} + +// String returns a human-readable description of this Command Result ID +func (id CommandResultId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Command: %q", id.CommandId), + } + return fmt.Sprintf("Command Result (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool_test.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult_test.go similarity index 53% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool_test.go rename to resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult_test.go index 8f6daedd6d3..0c55ce098fa 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool_test.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_commandresult_test.go @@ -1,4 +1,4 @@ -package sessionhostmanagements +package managedclusters import ( "testing" @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &HostPoolId{} +var _ resourceids.ResourceId = &CommandResultId{} -func TestNewHostPoolID(t *testing.T) { - id := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") +func TestNewCommandResultID(t *testing.T) { + id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,24 +22,28 @@ func TestNewHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostPoolName != "hostPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.CommandId != "commandId" { + t.Fatalf("Expected %q but got %q for Segment 'CommandId'", id.CommandId, "commandId") } } -func TestFormatHostPoolID(t *testing.T) { - actual := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName" +func TestFormatCommandResultID(t *testing.T) { + actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseHostPoolID(t *testing.T) { +func TestParseCommandResultID(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *CommandResultId }{ { // Incomplete URI @@ -73,33 +77,44 @@ func TestParseHostPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", + Expected: &CommandResultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolID(v.Input) + actual, err := ParseCommandResultID(v.Input) if err != nil { if v.Error { continue @@ -119,18 +134,22 @@ func TestParseHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.CommandId != v.Expected.CommandId { + t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) } } } -func TestParseHostPoolIDInsensitively(t *testing.T) { +func TestParseCommandResultIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *CommandResultId }{ { // Incomplete URI @@ -189,57 +208,79 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", + Expected: &CommandResultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE", - Expected: &HostPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostPoolName: "hOsTpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId", + Expected: &CommandResultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolIDInsensitively(v.Input) + actual, err := ParseCommandResultIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -259,17 +300,21 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.CommandId != v.Expected.CommandId { + t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) } } } -func TestSegmentsForHostPoolId(t *testing.T) { - segments := HostPoolId{}.Segments() +func TestSegmentsForCommandResultId(t *testing.T) { + segments := CommandResultId{}.Segments() if len(segments) == 0 { - t.Fatalf("HostPoolId has no segments") + t.Fatalf("CommandResultId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_location.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_location.go new file mode 100644 index 00000000000..79aa9b51c07 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_location.go @@ -0,0 +1,121 @@ +package managedclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) + } + + return nil +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.ContainerService/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_location_test.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_location_test.go new file mode 100644 index 00000000000..db0f4f67412 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_location_test.go @@ -0,0 +1,237 @@ +package managedclusters + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &LocationId{} + +func TestNewLocationID(t *testing.T) { + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") + } +} + +func TestFormatLocationID(t *testing.T) { + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseLocationID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + } +} + +func TestParseLocationIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNnAmE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + } +} + +func TestSegmentsForLocationId(t *testing.T) { + segments := LocationId{}.Segments() + if len(segments) == 0 { + t.Fatalf("LocationId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile.go new file mode 100644 index 00000000000..009771d0a59 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile.go @@ -0,0 +1,130 @@ +package managedclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&MeshRevisionProfileId{}) +} + +var _ resourceids.ResourceId = &MeshRevisionProfileId{} + +// MeshRevisionProfileId is a struct representing the Resource ID for a Mesh Revision Profile +type MeshRevisionProfileId struct { + SubscriptionId string + LocationName string + MeshRevisionProfileName string +} + +// NewMeshRevisionProfileID returns a new MeshRevisionProfileId struct +func NewMeshRevisionProfileID(subscriptionId string, locationName string, meshRevisionProfileName string) MeshRevisionProfileId { + return MeshRevisionProfileId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + MeshRevisionProfileName: meshRevisionProfileName, + } +} + +// ParseMeshRevisionProfileID parses 'input' into a MeshRevisionProfileId +func ParseMeshRevisionProfileID(input string) (*MeshRevisionProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&MeshRevisionProfileId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MeshRevisionProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseMeshRevisionProfileIDInsensitively parses 'input' case-insensitively into a MeshRevisionProfileId +// note: this method should only be used for API response data and not user input +func ParseMeshRevisionProfileIDInsensitively(input string) (*MeshRevisionProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&MeshRevisionProfileId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MeshRevisionProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *MeshRevisionProfileId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) + } + + if id.MeshRevisionProfileName, ok = input.Parsed["meshRevisionProfileName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "meshRevisionProfileName", input) + } + + return nil +} + +// ValidateMeshRevisionProfileID checks that 'input' can be parsed as a Mesh Revision Profile ID +func ValidateMeshRevisionProfileID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMeshRevisionProfileID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mesh Revision Profile ID +func (id MeshRevisionProfileId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.ContainerService/locations/%s/meshRevisionProfiles/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.MeshRevisionProfileName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mesh Revision Profile ID +func (id MeshRevisionProfileId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticMeshRevisionProfiles", "meshRevisionProfiles", "meshRevisionProfiles"), + resourceids.UserSpecifiedSegment("meshRevisionProfileName", "meshRevisionProfileName"), + } +} + +// String returns a human-readable description of this Mesh Revision Profile ID +func (id MeshRevisionProfileId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Mesh Revision Profile Name: %q", id.MeshRevisionProfileName), + } + return fmt.Sprintf("Mesh Revision Profile (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile_test.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile_test.go new file mode 100644 index 00000000000..a4e7a52ef61 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshrevisionprofile_test.go @@ -0,0 +1,282 @@ +package managedclusters + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &MeshRevisionProfileId{} + +func TestNewMeshRevisionProfileID(t *testing.T) { + id := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") + } + + if id.MeshRevisionProfileName != "meshRevisionProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'MeshRevisionProfileName'", id.MeshRevisionProfileName, "meshRevisionProfileName") + } +} + +func TestFormatMeshRevisionProfileID(t *testing.T) { + actual := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseMeshRevisionProfileID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MeshRevisionProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName", + Expected: &MeshRevisionProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + MeshRevisionProfileName: "meshRevisionProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMeshRevisionProfileID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + if actual.MeshRevisionProfileName != v.Expected.MeshRevisionProfileName { + t.Fatalf("Expected %q but got %q for MeshRevisionProfileName", v.Expected.MeshRevisionProfileName, actual.MeshRevisionProfileName) + } + + } +} + +func TestParseMeshRevisionProfileIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MeshRevisionProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName", + Expected: &MeshRevisionProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + MeshRevisionProfileName: "meshRevisionProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS/mEsHrEvIsIoNpRoFiLeNaMe", + Expected: &MeshRevisionProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNnAmE", + MeshRevisionProfileName: "mEsHrEvIsIoNpRoFiLeNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS/mEsHrEvIsIoNpRoFiLeNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMeshRevisionProfileIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + if actual.MeshRevisionProfileName != v.Expected.MeshRevisionProfileName { + t.Fatalf("Expected %q but got %q for MeshRevisionProfileName", v.Expected.MeshRevisionProfileName, actual.MeshRevisionProfileName) + } + + } +} + +func TestSegmentsForMeshRevisionProfileId(t *testing.T) { + segments := MeshRevisionProfileId{}.Segments() + if len(segments) == 0 { + t.Fatalf("MeshRevisionProfileId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile.go new file mode 100644 index 00000000000..c33efc10c79 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile.go @@ -0,0 +1,139 @@ +package managedclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&MeshUpgradeProfileId{}) +} + +var _ resourceids.ResourceId = &MeshUpgradeProfileId{} + +// MeshUpgradeProfileId is a struct representing the Resource ID for a Mesh Upgrade Profile +type MeshUpgradeProfileId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + MeshUpgradeProfileName string +} + +// NewMeshUpgradeProfileID returns a new MeshUpgradeProfileId struct +func NewMeshUpgradeProfileID(subscriptionId string, resourceGroupName string, managedClusterName string, meshUpgradeProfileName string) MeshUpgradeProfileId { + return MeshUpgradeProfileId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + MeshUpgradeProfileName: meshUpgradeProfileName, + } +} + +// ParseMeshUpgradeProfileID parses 'input' into a MeshUpgradeProfileId +func ParseMeshUpgradeProfileID(input string) (*MeshUpgradeProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&MeshUpgradeProfileId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MeshUpgradeProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseMeshUpgradeProfileIDInsensitively parses 'input' case-insensitively into a MeshUpgradeProfileId +// note: this method should only be used for API response data and not user input +func ParseMeshUpgradeProfileIDInsensitively(input string) (*MeshUpgradeProfileId, error) { + parser := resourceids.NewParserFromResourceIdType(&MeshUpgradeProfileId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := MeshUpgradeProfileId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *MeshUpgradeProfileId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.MeshUpgradeProfileName, ok = input.Parsed["meshUpgradeProfileName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "meshUpgradeProfileName", input) + } + + return nil +} + +// ValidateMeshUpgradeProfileID checks that 'input' can be parsed as a Mesh Upgrade Profile ID +func ValidateMeshUpgradeProfileID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseMeshUpgradeProfileID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Mesh Upgrade Profile ID +func (id MeshUpgradeProfileId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/meshUpgradeProfiles/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.MeshUpgradeProfileName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Mesh Upgrade Profile ID +func (id MeshUpgradeProfileId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticMeshUpgradeProfiles", "meshUpgradeProfiles", "meshUpgradeProfiles"), + resourceids.UserSpecifiedSegment("meshUpgradeProfileName", "meshUpgradeProfileName"), + } +} + +// String returns a human-readable description of this Mesh Upgrade Profile ID +func (id MeshUpgradeProfileId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Mesh Upgrade Profile Name: %q", id.MeshUpgradeProfileName), + } + return fmt.Sprintf("Mesh Upgrade Profile (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile_test.go b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile_test.go new file mode 100644 index 00000000000..eac2f86407e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/id_meshupgradeprofile_test.go @@ -0,0 +1,327 @@ +package managedclusters + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &MeshUpgradeProfileId{} + +func TestNewMeshUpgradeProfileID(t *testing.T) { + id := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.MeshUpgradeProfileName != "meshUpgradeProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'MeshUpgradeProfileName'", id.MeshUpgradeProfileName, "meshUpgradeProfileName") + } +} + +func TestFormatMeshUpgradeProfileID(t *testing.T) { + actual := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseMeshUpgradeProfileID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MeshUpgradeProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName", + Expected: &MeshUpgradeProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + MeshUpgradeProfileName: "meshUpgradeProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMeshUpgradeProfileID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.MeshUpgradeProfileName != v.Expected.MeshUpgradeProfileName { + t.Fatalf("Expected %q but got %q for MeshUpgradeProfileName", v.Expected.MeshUpgradeProfileName, actual.MeshUpgradeProfileName) + } + + } +} + +func TestParseMeshUpgradeProfileIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *MeshUpgradeProfileId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName", + Expected: &MeshUpgradeProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + MeshUpgradeProfileName: "meshUpgradeProfileName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs/mEsHuPgRaDePrOfIlEnAmE", + Expected: &MeshUpgradeProfileId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + MeshUpgradeProfileName: "mEsHuPgRaDePrOfIlEnAmE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs/mEsHuPgRaDePrOfIlEnAmE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseMeshUpgradeProfileIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.MeshUpgradeProfileName != v.Expected.MeshUpgradeProfileName { + t.Fatalf("Expected %q but got %q for MeshUpgradeProfileName", v.Expected.MeshUpgradeProfileName, actual.MeshUpgradeProfileName) + } + + } +} + +func TestSegmentsForMeshUpgradeProfileId(t *testing.T) { + segments := MeshUpgradeProfileId{}.Segments() + if len(segments) == 0 { + t.Fatalf("MeshUpgradeProfileId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_abortlatestoperation.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_abortlatestoperation.go new file mode 100644 index 00000000000..a37480f49c9 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_abortlatestoperation.go @@ -0,0 +1,71 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AbortLatestOperationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AbortLatestOperation ... +func (c ManagedClustersClient) AbortLatestOperation(ctx context.Context, id commonids.KubernetesClusterId) (result AbortLatestOperationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/abort", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AbortLatestOperationThenPoll performs AbortLatestOperation then polls until it's completed +func (c ManagedClustersClient) AbortLatestOperationThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { + result, err := c.AbortLatestOperation(ctx, id) + if err != nil { + return fmt.Errorf("performing AbortLatestOperation: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AbortLatestOperation: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_createorupdate.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_createorupdate.go new file mode 100644 index 00000000000..ee535475169 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_createorupdate.go @@ -0,0 +1,109 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ManagedCluster +} + +type CreateOrUpdateOperationOptions struct { + IfMatch *string + IfNoneMatch *string +} + +func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { + return CreateOrUpdateOperationOptions{} +} + +func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.IfMatch != nil { + out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) + } + if o.IfNoneMatch != nil { + out.Append("If-None-Match", fmt.Sprintf("%v", *o.IfNoneMatch)) + } + return &out +} + +func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// CreateOrUpdate ... +func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster, options CreateOrUpdateOperationOptions) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ManagedClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster, options CreateOrUpdateOperationOptions) error { + result, err := c.CreateOrUpdate(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_delete.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_delete.go similarity index 55% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_delete.go rename to resource-manager/containerservice/2024-09-01/managedclusters/method_delete.go index 0feb4e8763b..e73ea43ac3f 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_delete.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_delete.go @@ -1,11 +1,14 @@ -package appattachpackage +package managedclusters import ( "context" "fmt" "net/http" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" "github.com/hashicorp/go-azure-sdk/sdk/odata" ) @@ -13,12 +16,13 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DeleteOperationResponse struct { + Poller pollers.Poller HttpResponse *http.Response OData *odata.OData } type DeleteOperationOptions struct { - Force *bool + IfMatch *string } func DefaultDeleteOperationOptions() DeleteOperationOptions { @@ -27,7 +31,9 @@ func DefaultDeleteOperationOptions() DeleteOperationOptions { func (o DeleteOperationOptions) ToHeaders() *client.Headers { out := client.Headers{} - + if o.IfMatch != nil { + out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) + } return &out } @@ -39,19 +45,17 @@ func (o DeleteOperationOptions) ToOData() *odata.Query { func (o DeleteOperationOptions) ToQuery() *client.QueryParams { out := client.QueryParams{} - if o.Force != nil { - out.Append("force", fmt.Sprintf("%v", *o.Force)) - } + return &out } // Delete ... -func (c AppAttachPackageClient) Delete(ctx context.Context, id AppAttachPackageId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { +func (c ManagedClustersClient) Delete(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ + http.StatusAccepted, http.StatusNoContent, - http.StatusOK, }, HttpMethod: http.MethodDelete, OptionsObject: options, @@ -73,5 +77,24 @@ func (c AppAttachPackageClient) Delete(ctx context.Context, id AppAttachPackageI return } + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + return } + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ManagedClustersClient) DeleteThenPoll(ctx context.Context, id commonids.KubernetesClusterId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_get.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_get.go new file mode 100644 index 00000000000..5c5b9cd89b8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_get.go @@ -0,0 +1,54 @@ +package managedclusters + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ManagedCluster +} + +// Get ... +func (c ManagedClustersClient) Get(ctx context.Context, id commonids.KubernetesClusterId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model ManagedCluster + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_getaccessprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_getaccessprofile.go new file mode 100644 index 00000000000..99bbda7cca5 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_getaccessprofile.go @@ -0,0 +1,54 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetAccessProfileOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ManagedClusterAccessProfile +} + +// GetAccessProfile ... +func (c ManagedClustersClient) GetAccessProfile(ctx context.Context, id AccessProfileId) (result GetAccessProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model ManagedClusterAccessProfile + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_getcommandresult.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_getcommandresult.go new file mode 100644 index 00000000000..9cd6f99a5f9 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_getcommandresult.go @@ -0,0 +1,54 @@ +package managedclusters + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetCommandResultOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RunCommandResult +} + +// GetCommandResult ... +func (c ManagedClustersClient) GetCommandResult(ctx context.Context, id CommandResultId) (result GetCommandResultOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RunCommandResult + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshrevisionprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshrevisionprofile.go new file mode 100644 index 00000000000..aba6637b834 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshrevisionprofile.go @@ -0,0 +1,53 @@ +package managedclusters + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetMeshRevisionProfileOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *MeshRevisionProfile +} + +// GetMeshRevisionProfile ... +func (c ManagedClustersClient) GetMeshRevisionProfile(ctx context.Context, id MeshRevisionProfileId) (result GetMeshRevisionProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model MeshRevisionProfile + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshupgradeprofile.go new file mode 100644 index 00000000000..536044f5875 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_getmeshupgradeprofile.go @@ -0,0 +1,53 @@ +package managedclusters + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetMeshUpgradeProfileOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *MeshUpgradeProfile +} + +// GetMeshUpgradeProfile ... +func (c ManagedClustersClient) GetMeshUpgradeProfile(ctx context.Context, id MeshUpgradeProfileId) (result GetMeshUpgradeProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model MeshUpgradeProfile + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_getupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_getupgradeprofile.go new file mode 100644 index 00000000000..b5a5533d9e3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_getupgradeprofile.go @@ -0,0 +1,55 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUpgradeProfileOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ManagedClusterUpgradeProfile +} + +// GetUpgradeProfile ... +func (c ManagedClustersClient) GetUpgradeProfile(ctx context.Context, id commonids.KubernetesClusterId) (result GetUpgradeProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/upgradeProfiles/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model ManagedClusterUpgradeProfile + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_list.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_list.go new file mode 100644 index 00000000000..026d6c9e193 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_list.go @@ -0,0 +1,106 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ManagedCluster +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ManagedCluster +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c ManagedClustersClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusters", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ManagedCluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c ManagedClustersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ManagedClusterOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedClustersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ManagedClusterOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ManagedCluster, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listbyresourcegroup.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listbyresourcegroup.go new file mode 100644 index 00000000000..3243b394520 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ManagedCluster +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []ManagedCluster +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c ManagedClustersClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusters", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]ManagedCluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ManagedClusterOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ManagedClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]ManagedCluster, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusteradmincredentials.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusteradmincredentials.go new file mode 100644 index 00000000000..7ccb6f0d6eb --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusteradmincredentials.go @@ -0,0 +1,84 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListClusterAdminCredentialsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CredentialResults +} + +type ListClusterAdminCredentialsOperationOptions struct { + ServerFqdn *string +} + +func DefaultListClusterAdminCredentialsOperationOptions() ListClusterAdminCredentialsOperationOptions { + return ListClusterAdminCredentialsOperationOptions{} +} + +func (o ListClusterAdminCredentialsOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListClusterAdminCredentialsOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o ListClusterAdminCredentialsOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.ServerFqdn != nil { + out.Append("server-fqdn", fmt.Sprintf("%v", *o.ServerFqdn)) + } + return &out +} + +// ListClusterAdminCredentials ... +func (c ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterAdminCredentialsOperationOptions) (result ListClusterAdminCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + OptionsObject: options, + Path: fmt.Sprintf("%s/listClusterAdminCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model CredentialResults + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listclustermonitoringusercredentials.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclustermonitoringusercredentials.go new file mode 100644 index 00000000000..cdf8383752e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclustermonitoringusercredentials.go @@ -0,0 +1,84 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListClusterMonitoringUserCredentialsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CredentialResults +} + +type ListClusterMonitoringUserCredentialsOperationOptions struct { + ServerFqdn *string +} + +func DefaultListClusterMonitoringUserCredentialsOperationOptions() ListClusterMonitoringUserCredentialsOperationOptions { + return ListClusterMonitoringUserCredentialsOperationOptions{} +} + +func (o ListClusterMonitoringUserCredentialsOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListClusterMonitoringUserCredentialsOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o ListClusterMonitoringUserCredentialsOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.ServerFqdn != nil { + out.Append("server-fqdn", fmt.Sprintf("%v", *o.ServerFqdn)) + } + return &out +} + +// ListClusterMonitoringUserCredentials ... +func (c ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterMonitoringUserCredentialsOperationOptions) (result ListClusterMonitoringUserCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + OptionsObject: options, + Path: fmt.Sprintf("%s/listClusterMonitoringUserCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model CredentialResults + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusterusercredentials.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusterusercredentials.go new file mode 100644 index 00000000000..ce168c171aa --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listclusterusercredentials.go @@ -0,0 +1,88 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListClusterUserCredentialsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CredentialResults +} + +type ListClusterUserCredentialsOperationOptions struct { + Format *Format + ServerFqdn *string +} + +func DefaultListClusterUserCredentialsOperationOptions() ListClusterUserCredentialsOperationOptions { + return ListClusterUserCredentialsOperationOptions{} +} + +func (o ListClusterUserCredentialsOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListClusterUserCredentialsOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o ListClusterUserCredentialsOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Format != nil { + out.Append("format", fmt.Sprintf("%v", *o.Format)) + } + if o.ServerFqdn != nil { + out.Append("server-fqdn", fmt.Sprintf("%v", *o.ServerFqdn)) + } + return &out +} + +// ListClusterUserCredentials ... +func (c ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, id commonids.KubernetesClusterId, options ListClusterUserCredentialsOperationOptions) (result ListClusterUserCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + OptionsObject: options, + Path: fmt.Sprintf("%s/listClusterUserCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model CredentialResults + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listkubernetesversions.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listkubernetesversions.go new file mode 100644 index 00000000000..286125762cd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listkubernetesversions.go @@ -0,0 +1,54 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListKubernetesVersionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *KubernetesVersionListResult +} + +// ListKubernetesVersions ... +func (c ManagedClustersClient) ListKubernetesVersions(ctx context.Context, id LocationId) (result ListKubernetesVersionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/kubernetesVersions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model KubernetesVersionListResult + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshrevisionprofiles.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshrevisionprofiles.go new file mode 100644 index 00000000000..0172addb23c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshrevisionprofiles.go @@ -0,0 +1,105 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListMeshRevisionProfilesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]MeshRevisionProfile +} + +type ListMeshRevisionProfilesCompleteResult struct { + LatestHttpResponse *http.Response + Items []MeshRevisionProfile +} + +type ListMeshRevisionProfilesCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListMeshRevisionProfilesCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListMeshRevisionProfiles ... +func (c ManagedClustersClient) ListMeshRevisionProfiles(ctx context.Context, id LocationId) (result ListMeshRevisionProfilesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListMeshRevisionProfilesCustomPager{}, + Path: fmt.Sprintf("%s/meshRevisionProfiles", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]MeshRevisionProfile `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListMeshRevisionProfilesComplete retrieves all the results into a single object +func (c ManagedClustersClient) ListMeshRevisionProfilesComplete(ctx context.Context, id LocationId) (ListMeshRevisionProfilesCompleteResult, error) { + return c.ListMeshRevisionProfilesCompleteMatchingPredicate(ctx, id, MeshRevisionProfileOperationPredicate{}) +} + +// ListMeshRevisionProfilesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedClustersClient) ListMeshRevisionProfilesCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate MeshRevisionProfileOperationPredicate) (result ListMeshRevisionProfilesCompleteResult, err error) { + items := make([]MeshRevisionProfile, 0) + + resp, err := c.ListMeshRevisionProfiles(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListMeshRevisionProfilesCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshupgradeprofiles.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshupgradeprofiles.go new file mode 100644 index 00000000000..b73c93f81a9 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listmeshupgradeprofiles.go @@ -0,0 +1,106 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListMeshUpgradeProfilesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]MeshUpgradeProfile +} + +type ListMeshUpgradeProfilesCompleteResult struct { + LatestHttpResponse *http.Response + Items []MeshUpgradeProfile +} + +type ListMeshUpgradeProfilesCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListMeshUpgradeProfilesCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListMeshUpgradeProfiles ... +func (c ManagedClustersClient) ListMeshUpgradeProfiles(ctx context.Context, id commonids.KubernetesClusterId) (result ListMeshUpgradeProfilesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListMeshUpgradeProfilesCustomPager{}, + Path: fmt.Sprintf("%s/meshUpgradeProfiles", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]MeshUpgradeProfile `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListMeshUpgradeProfilesComplete retrieves all the results into a single object +func (c ManagedClustersClient) ListMeshUpgradeProfilesComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListMeshUpgradeProfilesCompleteResult, error) { + return c.ListMeshUpgradeProfilesCompleteMatchingPredicate(ctx, id, MeshUpgradeProfileOperationPredicate{}) +} + +// ListMeshUpgradeProfilesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedClustersClient) ListMeshUpgradeProfilesCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate MeshUpgradeProfileOperationPredicate) (result ListMeshUpgradeProfilesCompleteResult, err error) { + items := make([]MeshUpgradeProfile, 0) + + resp, err := c.ListMeshUpgradeProfiles(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListMeshUpgradeProfilesCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_listoutboundnetworkdependenciesendpoints.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_listoutboundnetworkdependenciesendpoints.go new file mode 100644 index 00000000000..21283e57ea3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_listoutboundnetworkdependenciesendpoints.go @@ -0,0 +1,106 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOutboundNetworkDependenciesEndpointsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]OutboundEnvironmentEndpoint +} + +type ListOutboundNetworkDependenciesEndpointsCompleteResult struct { + LatestHttpResponse *http.Response + Items []OutboundEnvironmentEndpoint +} + +type ListOutboundNetworkDependenciesEndpointsCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListOutboundNetworkDependenciesEndpointsCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListOutboundNetworkDependenciesEndpoints ... +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, id commonids.KubernetesClusterId) (result ListOutboundNetworkDependenciesEndpointsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListOutboundNetworkDependenciesEndpointsCustomPager{}, + Path: fmt.Sprintf("%s/outboundNetworkDependenciesEndpoints", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]OutboundEnvironmentEndpoint `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListOutboundNetworkDependenciesEndpointsComplete retrieves all the results into a single object +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, id commonids.KubernetesClusterId) (ListOutboundNetworkDependenciesEndpointsCompleteResult, error) { + return c.ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx, id, OutboundEnvironmentEndpointOperationPredicate{}) +} + +// ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate OutboundEnvironmentEndpointOperationPredicate) (result ListOutboundNetworkDependenciesEndpointsCompleteResult, err error) { + items := make([]OutboundEnvironmentEndpoint, 0) + + resp, err := c.ListOutboundNetworkDependenciesEndpoints(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListOutboundNetworkDependenciesEndpointsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_controlsessionhostupdatepost.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_resetaadprofile.go similarity index 56% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_controlsessionhostupdatepost.go rename to resource-manager/containerservice/2024-09-01/managedclusters/method_resetaadprofile.go index 903a233df20..abdbb59c018 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_controlsessionhostupdatepost.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_resetaadprofile.go @@ -1,10 +1,11 @@ -package sessionhostmanagement +package managedclusters import ( "context" "fmt" "net/http" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/sdk/client" "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" @@ -14,21 +15,22 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ControlSessionHostUpdatePostOperationResponse struct { +type ResetAADProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData } -// ControlSessionHostUpdatePost ... -func (c SessionHostManagementClient) ControlSessionHostUpdatePost(ctx context.Context, id HostPoolId, input HostPoolUpdateControlParameter) (result ControlSessionHostUpdatePostOperationResponse, err error) { +// ResetAADProfile ... +func (c ManagedClustersClient) ResetAADProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) (result ResetAADProfileOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusAccepted, + http.StatusOK, }, HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/sessionHostManagements/default/controlSessionHostUpdate", id.ID()), + Path: fmt.Sprintf("%s/resetAADProfile", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) @@ -58,15 +60,15 @@ func (c SessionHostManagementClient) ControlSessionHostUpdatePost(ctx context.Co return } -// ControlSessionHostUpdatePostThenPoll performs ControlSessionHostUpdatePost then polls until it's completed -func (c SessionHostManagementClient) ControlSessionHostUpdatePostThenPoll(ctx context.Context, id HostPoolId, input HostPoolUpdateControlParameter) error { - result, err := c.ControlSessionHostUpdatePost(ctx, id, input) +// ResetAADProfileThenPoll performs ResetAADProfile then polls until it's completed +func (c ManagedClustersClient) ResetAADProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterAADProfile) error { + result, err := c.ResetAADProfile(ctx, id, input) if err != nil { - return fmt.Errorf("performing ControlSessionHostUpdatePost: %+v", err) + return fmt.Errorf("performing ResetAADProfile: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ControlSessionHostUpdatePost: %+v", err) + return fmt.Errorf("polling after ResetAADProfile: %+v", err) } return nil diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_resetserviceprincipalprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_resetserviceprincipalprofile.go new file mode 100644 index 00000000000..54589acaf03 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_resetserviceprincipalprofile.go @@ -0,0 +1,75 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResetServicePrincipalProfileOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ResetServicePrincipalProfile ... +func (c ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) (result ResetServicePrincipalProfileOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resetServicePrincipalProfile", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ResetServicePrincipalProfileThenPoll performs ResetServicePrincipalProfile then polls until it's completed +func (c ManagedClustersClient) ResetServicePrincipalProfileThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input ManagedClusterServicePrincipalProfile) error { + result, err := c.ResetServicePrincipalProfile(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ResetServicePrincipalProfile: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ResetServicePrincipalProfile: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateclustercertificates.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateclustercertificates.go new file mode 100644 index 00000000000..3d04938f645 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateclustercertificates.go @@ -0,0 +1,71 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RotateClusterCertificatesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RotateClusterCertificates ... +func (c ManagedClustersClient) RotateClusterCertificates(ctx context.Context, id commonids.KubernetesClusterId) (result RotateClusterCertificatesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/rotateClusterCertificates", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RotateClusterCertificatesThenPoll performs RotateClusterCertificates then polls until it's completed +func (c ManagedClustersClient) RotateClusterCertificatesThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { + result, err := c.RotateClusterCertificates(ctx, id) + if err != nil { + return fmt.Errorf("performing RotateClusterCertificates: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RotateClusterCertificates: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateserviceaccountsigningkeys.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateserviceaccountsigningkeys.go new file mode 100644 index 00000000000..b4cecc16d85 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_rotateserviceaccountsigningkeys.go @@ -0,0 +1,71 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RotateServiceAccountSigningKeysOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RotateServiceAccountSigningKeys ... +func (c ManagedClustersClient) RotateServiceAccountSigningKeys(ctx context.Context, id commonids.KubernetesClusterId) (result RotateServiceAccountSigningKeysOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/rotateServiceAccountSigningKeys", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RotateServiceAccountSigningKeysThenPoll performs RotateServiceAccountSigningKeys then polls until it's completed +func (c ManagedClustersClient) RotateServiceAccountSigningKeysThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { + result, err := c.RotateServiceAccountSigningKeys(ctx, id) + if err != nil { + return fmt.Errorf("performing RotateServiceAccountSigningKeys: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RotateServiceAccountSigningKeys: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_runcommand.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_runcommand.go new file mode 100644 index 00000000000..b64b4ec1b20 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_runcommand.go @@ -0,0 +1,76 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *RunCommandResult +} + +// RunCommand ... +func (c ManagedClustersClient) RunCommand(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) (result RunCommandOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/runCommand", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RunCommandThenPoll performs RunCommand then polls until it's completed +func (c ManagedClustersClient) RunCommandThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input RunCommandRequest) error { + result, err := c.RunCommand(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RunCommand: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RunCommand: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_start.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_start.go new file mode 100644 index 00000000000..ba4549e7615 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_start.go @@ -0,0 +1,71 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Start ... +func (c ManagedClustersClient) Start(ctx context.Context, id commonids.KubernetesClusterId) (result StartOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/start", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// StartThenPoll performs Start then polls until it's completed +func (c ManagedClustersClient) StartThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { + result, err := c.Start(ctx, id) + if err != nil { + return fmt.Errorf("performing Start: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Start: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_stop.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_stop.go new file mode 100644 index 00000000000..3bec609e3b4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_stop.go @@ -0,0 +1,71 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StopOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Stop ... +func (c ManagedClustersClient) Stop(ctx context.Context, id commonids.KubernetesClusterId) (result StopOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/stop", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// StopThenPoll performs Stop then polls until it's completed +func (c ManagedClustersClient) StopThenPoll(ctx context.Context, id commonids.KubernetesClusterId) error { + result, err := c.Stop(ctx, id) + if err != nil { + return fmt.Errorf("performing Stop: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Stop: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/method_updatetags.go b/resource-manager/containerservice/2024-09-01/managedclusters/method_updatetags.go new file mode 100644 index 00000000000..ef3920b358e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/method_updatetags.go @@ -0,0 +1,104 @@ +package managedclusters + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateTagsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ManagedCluster +} + +type UpdateTagsOperationOptions struct { + IfMatch *string +} + +func DefaultUpdateTagsOperationOptions() UpdateTagsOperationOptions { + return UpdateTagsOperationOptions{} +} + +func (o UpdateTagsOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + if o.IfMatch != nil { + out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) + } + return &out +} + +func (o UpdateTagsOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o UpdateTagsOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + + return &out +} + +// UpdateTags ... +func (c ManagedClustersClient) UpdateTags(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject, options UpdateTagsOperationOptions) (result UpdateTagsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateTagsThenPoll performs UpdateTags then polls until it's completed +func (c ManagedClustersClient) UpdateTagsThenPoll(ctx context.Context, id commonids.KubernetesClusterId, input TagsObject, options UpdateTagsOperationOptions) error { + result, err := c.UpdateTags(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing UpdateTags: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UpdateTags: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_accessprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_accessprofile.go new file mode 100644 index 00000000000..c13b64ab25d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_accessprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessProfile struct { + KubeConfig *string `json:"kubeConfig,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworking.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworking.go new file mode 100644 index 00000000000..48c6487fdee --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworking.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdvancedNetworking struct { + Enabled *bool `json:"enabled,omitempty"` + Observability *AdvancedNetworkingObservability `json:"observability,omitempty"` + Security *AdvancedNetworkingSecurity `json:"security,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingobservability.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingobservability.go new file mode 100644 index 00000000000..a491cdc7a17 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingobservability.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdvancedNetworkingObservability struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingsecurity.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingsecurity.go new file mode 100644 index 00000000000..9243f025d77 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_advancednetworkingsecurity.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdvancedNetworkingSecurity struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolnetworkprofile.go new file mode 100644 index 00000000000..1a5b19f5db1 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolnetworkprofile.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolNetworkProfile struct { + AllowedHostPorts *[]PortRange `json:"allowedHostPorts,omitempty"` + ApplicationSecurityGroups *[]string `json:"applicationSecurityGroups,omitempty"` + NodePublicIPTags *[]IPTag `json:"nodePublicIPTags,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolsecurityprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolsecurityprofile.go new file mode 100644 index 00000000000..d4e84920034 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolsecurityprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolSecurityProfile struct { + EnableSecureBoot *bool `json:"enableSecureBoot,omitempty"` + EnableVTPM *bool `json:"enableVTPM,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolupgradesettings.go new file mode 100644 index 00000000000..741d796f8a3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolupgradesettings.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolUpgradeSettings struct { + DrainTimeoutInMinutes *int64 `json:"drainTimeoutInMinutes,omitempty"` + MaxSurge *string `json:"maxSurge,omitempty"` + NodeSoakDurationInMinutes *int64 `json:"nodeSoakDurationInMinutes,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolwindowsprofile.go new file mode 100644 index 00000000000..5558f04ed00 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_agentpoolwindowsprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AgentPoolWindowsProfile struct { + DisableOutboundNat *bool `json:"disableOutboundNat,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_azurekeyvaultkms.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_azurekeyvaultkms.go new file mode 100644 index 00000000000..57c4e7848f3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_azurekeyvaultkms.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureKeyVaultKms struct { + Enabled *bool `json:"enabled,omitempty"` + KeyId *string `json:"keyId,omitempty"` + KeyVaultNetworkAccess *KeyVaultNetworkAccessTypes `json:"keyVaultNetworkAccess,omitempty"` + KeyVaultResourceId *string `json:"keyVaultResourceId,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_clusterupgradesettings.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_clusterupgradesettings.go new file mode 100644 index 00000000000..1510493ca17 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_clusterupgradesettings.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpgradeSettings struct { + OverrideSettings *UpgradeOverrideSettings `json:"overrideSettings,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_commandresultproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_commandresultproperties.go new file mode 100644 index 00000000000..745a87ae4ea --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_commandresultproperties.go @@ -0,0 +1,43 @@ +package managedclusters + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CommandResultProperties struct { + ExitCode *int64 `json:"exitCode,omitempty"` + FinishedAt *string `json:"finishedAt,omitempty"` + Logs *string `json:"logs,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Reason *string `json:"reason,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` +} + +func (o *CommandResultProperties) GetFinishedAtAsTime() (*time.Time, error) { + if o.FinishedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.FinishedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *CommandResultProperties) SetFinishedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.FinishedAt = &formatted +} + +func (o *CommandResultProperties) GetStartedAtAsTime() (*time.Time, error) { + if o.StartedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *CommandResultProperties) SetStartedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedAt = &formatted +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_compatibleversions.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_compatibleversions.go new file mode 100644 index 00000000000..585f8e04d7b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_compatibleversions.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CompatibleVersions struct { + Name *string `json:"name,omitempty"` + Versions *[]string `json:"versions,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicelinuxprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicelinuxprofile.go new file mode 100644 index 00000000000..a3abf14adeb --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicelinuxprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerServiceLinuxProfile struct { + AdminUsername string `json:"adminUsername"` + Ssh ContainerServiceSshConfiguration `json:"ssh"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicenetworkprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicenetworkprofile.go new file mode 100644 index 00000000000..14fe9ec66f6 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicenetworkprofile.go @@ -0,0 +1,23 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerServiceNetworkProfile struct { + AdvancedNetworking *AdvancedNetworking `json:"advancedNetworking,omitempty"` + DnsServiceIP *string `json:"dnsServiceIP,omitempty"` + IPFamilies *[]IPFamily `json:"ipFamilies,omitempty"` + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` + LoadBalancerSku *LoadBalancerSku `json:"loadBalancerSku,omitempty"` + NatGatewayProfile *ManagedClusterNATGatewayProfile `json:"natGatewayProfile,omitempty"` + NetworkDataplane *NetworkDataplane `json:"networkDataplane,omitempty"` + NetworkMode *NetworkMode `json:"networkMode,omitempty"` + NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` + NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` + NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` + OutboundType *OutboundType `json:"outboundType,omitempty"` + PodCidr *string `json:"podCidr,omitempty"` + PodCidrs *[]string `json:"podCidrs,omitempty"` + ServiceCidr *string `json:"serviceCidr,omitempty"` + ServiceCidrs *[]string `json:"serviceCidrs,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshconfiguration.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshconfiguration.go new file mode 100644 index 00000000000..4bf259bd15d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshconfiguration.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerServiceSshConfiguration struct { + PublicKeys []ContainerServiceSshPublicKey `json:"publicKeys"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshpublickey.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshpublickey.go new file mode 100644 index 00000000000..7796cdf6a90 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_containerservicesshpublickey.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ContainerServiceSshPublicKey struct { + KeyData string `json:"keyData"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_creationdata.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_creationdata.go new file mode 100644 index 00000000000..f2f19907006 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_creationdata.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreationData struct { + SourceResourceId *string `json:"sourceResourceId,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresult.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresult.go new file mode 100644 index 00000000000..7002f56084e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresult.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialResult struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresults.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresults.go new file mode 100644 index 00000000000..c572432888e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_credentialresults.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialResults struct { + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdependency.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdependency.go new file mode 100644 index 00000000000..ae8639b529b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdependency.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EndpointDependency struct { + DomainName *string `json:"domainName,omitempty"` + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdetail.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdetail.go new file mode 100644 index 00000000000..de73a2e9168 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_endpointdetail.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EndpointDetail struct { + Description *string `json:"description,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + Port *int64 `json:"port,omitempty"` + Protocol *string `json:"protocol,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_iptag.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_iptag.go new file mode 100644 index 00000000000..0aefb50d15f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_iptag.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPTag struct { + IPTagType *string `json:"ipTagType,omitempty"` + Tag *string `json:"tag,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_azureactivedirectoryinfoproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istiocertificateauthority.go similarity index 54% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_azureactivedirectoryinfoproperties.go rename to resource-manager/containerservice/2024-09-01/managedclusters/model_istiocertificateauthority.go index 03934073a0a..1580575b782 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_azureactivedirectoryinfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istiocertificateauthority.go @@ -1,8 +1,8 @@ -package sessionhostconfiguration +package managedclusters // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type AzureActiveDirectoryInfoProperties struct { - MdmProviderGuid string `json:"mdmProviderGuid"` +type IstioCertificateAuthority struct { + Plugin *IstioPluginCertificateAuthority `json:"plugin,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_istiocomponents.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istiocomponents.go new file mode 100644 index 00000000000..6dff6ff1534 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istiocomponents.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IstioComponents struct { + EgressGateways *[]IstioEgressGateway `json:"egressGateways,omitempty"` + IngressGateways *[]IstioIngressGateway `json:"ingressGateways,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_istioegressgateway.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioegressgateway.go new file mode 100644 index 00000000000..40497051c52 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioegressgateway.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IstioEgressGateway struct { + Enabled bool `json:"enabled"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_istioingressgateway.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioingressgateway.go new file mode 100644 index 00000000000..12832f48114 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioingressgateway.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IstioIngressGateway struct { + Enabled bool `json:"enabled"` + Mode IstioIngressGatewayMode `json:"mode"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_istioplugincertificateauthority.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioplugincertificateauthority.go new file mode 100644 index 00000000000..4ae2f736c6a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioplugincertificateauthority.go @@ -0,0 +1,12 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IstioPluginCertificateAuthority struct { + CertChainObjectName *string `json:"certChainObjectName,omitempty"` + CertObjectName *string `json:"certObjectName,omitempty"` + KeyObjectName *string `json:"keyObjectName,omitempty"` + KeyVaultId *string `json:"keyVaultId,omitempty"` + RootCertObjectName *string `json:"rootCertObjectName,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_istioservicemesh.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioservicemesh.go new file mode 100644 index 00000000000..968c2f018dc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_istioservicemesh.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IstioServiceMesh struct { + CertificateAuthority *IstioCertificateAuthority `json:"certificateAuthority,omitempty"` + Components *IstioComponents `json:"components,omitempty"` + Revisions *[]string `json:"revisions,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_kubeletconfig.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubeletconfig.go new file mode 100644 index 00000000000..0f4036b4e7c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubeletconfig.go @@ -0,0 +1,18 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubeletConfig struct { + AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"` + ContainerLogMaxFiles *int64 `json:"containerLogMaxFiles,omitempty"` + ContainerLogMaxSizeMB *int64 `json:"containerLogMaxSizeMB,omitempty"` + CpuCfsQuota *bool `json:"cpuCfsQuota,omitempty"` + CpuCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` + CpuManagerPolicy *string `json:"cpuManagerPolicy,omitempty"` + FailSwapOn *bool `json:"failSwapOn,omitempty"` + ImageGcHighThreshold *int64 `json:"imageGcHighThreshold,omitempty"` + ImageGcLowThreshold *int64 `json:"imageGcLowThreshold,omitempty"` + PodMaxPids *int64 `json:"podMaxPids,omitempty"` + TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetespatchversion.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetespatchversion.go new file mode 100644 index 00000000000..017737dac6a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetespatchversion.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesPatchVersion struct { + Upgrades *[]string `json:"upgrades,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversion.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversion.go new file mode 100644 index 00000000000..d1ad17500d2 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversion.go @@ -0,0 +1,12 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersion struct { + Capabilities *KubernetesVersionCapabilities `json:"capabilities,omitempty"` + IsDefault *bool `json:"isDefault,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + PatchVersions *map[string]KubernetesPatchVersion `json:"patchVersions,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_azureactivedirectoryinfoproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversioncapabilities.go similarity index 53% rename from resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_azureactivedirectoryinfoproperties.go rename to resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversioncapabilities.go index 28ac3315c7f..b5729422404 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_azureactivedirectoryinfoproperties.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversioncapabilities.go @@ -1,8 +1,8 @@ -package activesessionhostconfiguration +package managedclusters // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type AzureActiveDirectoryInfoProperties struct { - MdmProviderGuid string `json:"mdmProviderGuid"` +type KubernetesVersionCapabilities struct { + SupportPlan *[]KubernetesSupportPlan `json:"supportPlan,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversionlistresult.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversionlistresult.go new file mode 100644 index 00000000000..a8b1127a230 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_kubernetesversionlistresult.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesVersionListResult struct { + Values *[]KubernetesVersion `json:"values,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_linuxosconfig.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_linuxosconfig.go new file mode 100644 index 00000000000..431f6faa2aa --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_linuxosconfig.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxOSConfig struct { + SwapFileSizeMB *int64 `json:"swapFileSizeMB,omitempty"` + Sysctls *SysctlConfig `json:"sysctls,omitempty"` + TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"` + TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedcluster.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedcluster.go new file mode 100644 index 00000000000..1eafd7b3285 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedcluster.go @@ -0,0 +1,24 @@ +package managedclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedCluster struct { + ETag *string `json:"eTag,omitempty"` + ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemOrUserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ManagedClusterProperties `json:"properties,omitempty"` + Sku *ManagedClusterSKU `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraadprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraadprofile.go new file mode 100644 index 00000000000..271addb1fd4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraadprofile.go @@ -0,0 +1,14 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAADProfile struct { + AdminGroupObjectIDs *[]string `json:"adminGroupObjectIDs,omitempty"` + ClientAppID *string `json:"clientAppID,omitempty"` + EnableAzureRBAC *bool `json:"enableAzureRBAC,omitempty"` + Managed *bool `json:"managed,omitempty"` + ServerAppID *string `json:"serverAppID,omitempty"` + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + TenantID *string `json:"tenantID,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraccessprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraccessprofile.go new file mode 100644 index 00000000000..e248b2a253b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraccessprofile.go @@ -0,0 +1,18 @@ +package managedclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAccessProfile struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AccessProfile `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraddonprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraddonprofile.go new file mode 100644 index 00000000000..7dc1f865d9d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteraddonprofile.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAddonProfile struct { + Config *map[string]string `json:"config,omitempty"` + Enabled bool `json:"enabled"` + Identity *UserAssignedIdentity `json:"identity,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteragentpoolprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteragentpoolprofile.go new file mode 100644 index 00000000000..87452a5fbd7 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteragentpoolprofile.go @@ -0,0 +1,58 @@ +package managedclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAgentPoolProfile struct { + AvailabilityZones *zones.Schema `json:"availabilityZones,omitempty"` + CapacityReservationGroupID *string `json:"capacityReservationGroupID,omitempty"` + Count *int64 `json:"count,omitempty"` + CreationData *CreationData `json:"creationData,omitempty"` + CurrentOrchestratorVersion *string `json:"currentOrchestratorVersion,omitempty"` + ETag *string `json:"eTag,omitempty"` + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + EnableFIPS *bool `json:"enableFIPS,omitempty"` + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + HostGroupID *string `json:"hostGroupID,omitempty"` + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + KubeletDiskType *KubeletDiskType `json:"kubeletDiskType,omitempty"` + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + MaxCount *int64 `json:"maxCount,omitempty"` + MaxPods *int64 `json:"maxPods,omitempty"` + MinCount *int64 `json:"minCount,omitempty"` + Mode *AgentPoolMode `json:"mode,omitempty"` + Name string `json:"name"` + NetworkProfile *AgentPoolNetworkProfile `json:"networkProfile,omitempty"` + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + NodeLabels *map[string]string `json:"nodeLabels,omitempty"` + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + NodeTaints *[]string `json:"nodeTaints,omitempty"` + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + OsDiskSizeGB *int64 `json:"osDiskSizeGB,omitempty"` + OsDiskType *OSDiskType `json:"osDiskType,omitempty"` + OsSKU *OSSKU `json:"osSKU,omitempty"` + OsType *OSType `json:"osType,omitempty"` + PodSubnetID *string `json:"podSubnetID,omitempty"` + PowerState *PowerState `json:"powerState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` + ScaleDownMode *ScaleDownMode `json:"scaleDownMode,omitempty"` + ScaleSetEvictionPolicy *ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + ScaleSetPriority *ScaleSetPriority `json:"scaleSetPriority,omitempty"` + SecurityProfile *AgentPoolSecurityProfile `json:"securityProfile,omitempty"` + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *AgentPoolType `json:"type,omitempty"` + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + VMSize *string `json:"vmSize,omitempty"` + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + WindowsProfile *AgentPoolWindowsProfile `json:"windowsProfile,omitempty"` + WorkloadRuntime *WorkloadRuntime `json:"workloadRuntime,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterapiserveraccessprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterapiserveraccessprofile.go new file mode 100644 index 00000000000..30b24b4e52d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterapiserveraccessprofile.go @@ -0,0 +1,12 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAPIServerAccessProfile struct { + AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` + DisableRunCommand *bool `json:"disableRunCommand,omitempty"` + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` + EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` + PrivateDNSZone *string `json:"privateDNSZone,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterautoupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterautoupgradeprofile.go new file mode 100644 index 00000000000..e43a6df257f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterautoupgradeprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAutoUpgradeProfile struct { + NodeOSUpgradeChannel *NodeOSUpgradeChannel `json:"nodeOSUpgradeChannel,omitempty"` + UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofile.go new file mode 100644 index 00000000000..8a18140e45a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAzureMonitorProfile struct { + Metrics *ManagedClusterAzureMonitorProfileMetrics `json:"metrics,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go new file mode 100644 index 00000000000..ef0fb9066e2 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAzureMonitorProfileKubeStateMetrics struct { + MetricAnnotationsAllowList *string `json:"metricAnnotationsAllowList,omitempty"` + MetricLabelsAllowlist *string `json:"metricLabelsAllowlist,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilemetrics.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilemetrics.go new file mode 100644 index 00000000000..5c173441517 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterazuremonitorprofilemetrics.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterAzureMonitorProfileMetrics struct { + Enabled bool `json:"enabled"` + KubeStateMetrics *ManagedClusterAzureMonitorProfileKubeStateMetrics `json:"kubeStateMetrics,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustercostanalysis.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustercostanalysis.go new file mode 100644 index 00000000000..a54a571fe4e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustercostanalysis.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterCostAnalysis struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterhttpproxyconfig.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterhttpproxyconfig.go new file mode 100644 index 00000000000..33161aad969 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterhttpproxyconfig.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterHTTPProxyConfig struct { + HTTPProxy *string `json:"httpProxy,omitempty"` + HTTPSProxy *string `json:"httpsProxy,omitempty"` + NoProxy *[]string `json:"noProxy,omitempty"` + TrustedCa *string `json:"trustedCa,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofile.go new file mode 100644 index 00000000000..ef54c8e8069 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterIngressProfile struct { + WebAppRouting *ManagedClusterIngressProfileWebAppRouting `json:"webAppRouting,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofilewebapprouting.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofilewebapprouting.go new file mode 100644 index 00000000000..b8dc1b3b921 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteringressprofilewebapprouting.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterIngressProfileWebAppRouting struct { + DnsZoneResourceIds *[]string `json:"dnsZoneResourceIds,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Identity *UserAssignedIdentity `json:"identity,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofile.go new file mode 100644 index 00000000000..0d2207851bd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofile.go @@ -0,0 +1,15 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterLoadBalancerProfile struct { + AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` + BackendPoolType *BackendPoolType `json:"backendPoolType,omitempty"` + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + EnableMultipleStandardLoadBalancers *bool `json:"enableMultipleStandardLoadBalancers,omitempty"` + IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go new file mode 100644 index 00000000000..b8d24680fed --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + Count *int64 `json:"count,omitempty"` + CountIPv6 *int64 `json:"countIPv6,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go new file mode 100644 index 00000000000..76893c76d85 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go new file mode 100644 index 00000000000..f0a60f5817e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermanagedoutboundipprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermanagedoutboundipprofile.go new file mode 100644 index 00000000000..ec079b6cdf4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermanagedoutboundipprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterManagedOutboundIPProfile struct { + Count *int64 `json:"count,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermetricsprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermetricsprofile.go new file mode 100644 index 00000000000..fd466216881 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustermetricsprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterMetricsProfile struct { + CostAnalysis *ManagedClusterCostAnalysis `json:"costAnalysis,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternatgatewayprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternatgatewayprofile.go new file mode 100644 index 00000000000..a7e37699c62 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternatgatewayprofile.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterNATGatewayProfile struct { + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` + ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternoderesourcegroupprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternoderesourcegroupprofile.go new file mode 100644 index 00000000000..1ae3147c267 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusternoderesourcegroupprofile.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterNodeResourceGroupProfile struct { + RestrictionLevel *RestrictionLevel `json:"restrictionLevel,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteroidcissuerprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteroidcissuerprofile.go new file mode 100644 index 00000000000..b5d3be88f7d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusteroidcissuerprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterOIDCIssuerProfile struct { + Enabled *bool `json:"enabled,omitempty"` + IssuerURL *string `json:"issuerURL,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentity.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentity.go new file mode 100644 index 00000000000..3bfb6799645 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentity.go @@ -0,0 +1,13 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentity struct { + BindingSelector *string `json:"bindingSelector,omitempty"` + Identity UserAssignedIdentity `json:"identity"` + Name string `json:"name"` + Namespace string `json:"namespace"` + ProvisioningInfo *ManagedClusterPodIdentityProvisioningInfo `json:"provisioningInfo,omitempty"` + ProvisioningState *ManagedClusterPodIdentityProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityexception.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityexception.go new file mode 100644 index 00000000000..28a710f9b5c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityexception.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentityException struct { + Name string `json:"name"` + Namespace string `json:"namespace"` + PodLabels map[string]string `json:"podLabels"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprofile.go new file mode 100644 index 00000000000..e32db30028a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprofile.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentityProfile struct { + AllowNetworkPluginKubenet *bool `json:"allowNetworkPluginKubenet,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + UserAssignedIdentities *[]ManagedClusterPodIdentity `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentityExceptions *[]ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerror.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerror.go new file mode 100644 index 00000000000..1fb66d9034f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerror.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentityProvisioningError struct { + Error *ManagedClusterPodIdentityProvisioningErrorBody `json:"error,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go new file mode 100644 index 00000000000..db4466f80bf --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentityProvisioningErrorBody struct { + Code *string `json:"code,omitempty"` + Details *[]ManagedClusterPodIdentityProvisioningErrorBody `json:"details,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioninginfo.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioninginfo.go new file mode 100644 index 00000000000..60464e39c82 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpodidentityprovisioninginfo.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPodIdentityProvisioningInfo struct { + Error *ManagedClusterPodIdentityProvisioningError `json:"error,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofile.go new file mode 100644 index 00000000000..7bafa5df972 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofile.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPoolUpgradeProfile struct { + KubernetesVersion string `json:"kubernetesVersion"` + Name *string `json:"name,omitempty"` + OsType OSType `json:"osType"` + Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesInlined `json:"upgrades,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go new file mode 100644 index 00000000000..ccc02dd9957 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPoolUpgradeProfileUpgradesInlined struct { + IsPreview *bool `json:"isPreview,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterproperties.go new file mode 100644 index 00000000000..39d835f634b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterproperties.go @@ -0,0 +1,49 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterProperties struct { + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + AddonProfiles *map[string]ManagedClusterAddonProfile `json:"addonProfiles,omitempty"` + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + ApiServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` + AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + AzureMonitorProfile *ManagedClusterAzureMonitorProfile `json:"azureMonitorProfile,omitempty"` + AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty"` + CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty"` + DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` + DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` + DnsPrefix *string `json:"dnsPrefix,omitempty"` + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + EnableRBAC *bool `json:"enableRBAC,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` + HTTPProxyConfig *ManagedClusterHTTPProxyConfig `json:"httpProxyConfig,omitempty"` + IdentityProfile *map[string]UserAssignedIdentity `json:"identityProfile,omitempty"` + IngressProfile *ManagedClusterIngressProfile `json:"ingressProfile,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` + MaxAgentPools *int64 `json:"maxAgentPools,omitempty"` + MetricsProfile *ManagedClusterMetricsProfile `json:"metricsProfile,omitempty"` + NetworkProfile *ContainerServiceNetworkProfile `json:"networkProfile,omitempty"` + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + NodeResourceGroupProfile *ManagedClusterNodeResourceGroupProfile `json:"nodeResourceGroupProfile,omitempty"` + OidcIssuerProfile *ManagedClusterOIDCIssuerProfile `json:"oidcIssuerProfile,omitempty"` + PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"` + PowerState *PowerState `json:"powerState,omitempty"` + PrivateFQDN *string `json:"privateFQDN,omitempty"` + PrivateLinkResources *[]PrivateLinkResource `json:"privateLinkResources,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ResourceUID *string `json:"resourceUID,omitempty"` + SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` + ServiceMeshProfile *ServiceMeshProfile `json:"serviceMeshProfile,omitempty"` + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + StorageProfile *ManagedClusterStorageProfile `json:"storageProfile,omitempty"` + SupportPlan *KubernetesSupportPlan `json:"supportPlan,omitempty"` + UpgradeSettings *ClusterUpgradeSettings `json:"upgradeSettings,omitempty"` + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + WorkloadAutoScalerProfile *ManagedClusterWorkloadAutoScalerProfile `json:"workloadAutoScalerProfile,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpropertiesautoscalerprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpropertiesautoscalerprofile.go new file mode 100644 index 00000000000..3f718456e6e --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterpropertiesautoscalerprofile.go @@ -0,0 +1,27 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterPropertiesAutoScalerProfile struct { + BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"` + DaemonsetEvictionForEmptyNodes *bool `json:"daemonset-eviction-for-empty-nodes,omitempty"` + DaemonsetEvictionForOccupiedNodes *bool `json:"daemonset-eviction-for-occupied-nodes,omitempty"` + Expander *Expander `json:"expander,omitempty"` + IgnoreDaemonsetsUtilization *bool `json:"ignore-daemonsets-utilization,omitempty"` + MaxEmptyBulkDelete *string `json:"max-empty-bulk-delete,omitempty"` + MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"` + MaxNodeProvisionTime *string `json:"max-node-provision-time,omitempty"` + MaxTotalUnreadyPercentage *string `json:"max-total-unready-percentage,omitempty"` + NewPodScaleUpDelay *string `json:"new-pod-scale-up-delay,omitempty"` + OkTotalUnreadyCount *string `json:"ok-total-unready-count,omitempty"` + ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"` + ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"` + ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"` + ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"` + ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"` + ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"` + ScanInterval *string `json:"scan-interval,omitempty"` + SkipNodesWithLocalStorage *string `json:"skip-nodes-with-local-storage,omitempty"` + SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofile.go new file mode 100644 index 00000000000..a7b526d7952 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofile.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSecurityProfile struct { + AzureKeyVaultKms *AzureKeyVaultKms `json:"azureKeyVaultKms,omitempty"` + Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` + ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` + WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefender.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefender.go new file mode 100644 index 00000000000..c63debde097 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefender.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSecurityProfileDefender struct { + LogAnalyticsWorkspaceResourceId *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` + SecurityMonitoring *ManagedClusterSecurityProfileDefenderSecurityMonitoring `json:"securityMonitoring,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go new file mode 100644 index 00000000000..de84c795fec --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSecurityProfileDefenderSecurityMonitoring struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileimagecleaner.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileimagecleaner.go new file mode 100644 index 00000000000..eb3e2ea7007 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileimagecleaner.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSecurityProfileImageCleaner struct { + Enabled *bool `json:"enabled,omitempty"` + IntervalHours *int64 `json:"intervalHours,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileworkloadidentity.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileworkloadidentity.go new file mode 100644 index 00000000000..84f0312767b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersecurityprofileworkloadidentity.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSecurityProfileWorkloadIdentity struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterserviceprincipalprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterserviceprincipalprofile.go new file mode 100644 index 00000000000..2a03beecdcc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterserviceprincipalprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterServicePrincipalProfile struct { + ClientId string `json:"clientId"` + Secret *string `json:"secret,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersku.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersku.go new file mode 100644 index 00000000000..a4dcf9c50d3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclustersku.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterSKU struct { + Name *ManagedClusterSKUName `json:"name,omitempty"` + Tier *ManagedClusterSKUTier `json:"tier,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofile.go new file mode 100644 index 00000000000..11073ae103d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofile.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterStorageProfile struct { + BlobCSIDriver *ManagedClusterStorageProfileBlobCSIDriver `json:"blobCSIDriver,omitempty"` + DiskCSIDriver *ManagedClusterStorageProfileDiskCSIDriver `json:"diskCSIDriver,omitempty"` + FileCSIDriver *ManagedClusterStorageProfileFileCSIDriver `json:"fileCSIDriver,omitempty"` + SnapshotController *ManagedClusterStorageProfileSnapshotController `json:"snapshotController,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofileblobcsidriver.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofileblobcsidriver.go new file mode 100644 index 00000000000..dc0e951be6b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofileblobcsidriver.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterStorageProfileBlobCSIDriver struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilediskcsidriver.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilediskcsidriver.go new file mode 100644 index 00000000000..11eb0e5deb1 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilediskcsidriver.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterStorageProfileDiskCSIDriver struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilefilecsidriver.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilefilecsidriver.go new file mode 100644 index 00000000000..986ece9d933 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilefilecsidriver.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterStorageProfileFileCSIDriver struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go new file mode 100644 index 00000000000..d46ee10b683 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterStorageProfileSnapshotController struct { + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofile.go new file mode 100644 index 00000000000..86274cdb14a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofile.go @@ -0,0 +1,11 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterUpgradeProfile struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ManagedClusterUpgradeProfileProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofileproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofileproperties.go new file mode 100644 index 00000000000..4db4b126760 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterupgradeprofileproperties.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterUpgradeProfileProperties struct { + AgentPoolProfiles []ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles"` + ControlPlaneProfile ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterwindowsprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterwindowsprofile.go new file mode 100644 index 00000000000..8e3cffdace8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterwindowsprofile.go @@ -0,0 +1,12 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterWindowsProfile struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AdminUsername string `json:"adminUsername"` + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` + LicenseType *LicenseType `json:"licenseType,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofile.go new file mode 100644 index 00000000000..891a44a0084 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterWorkloadAutoScalerProfile struct { + Keda *ManagedClusterWorkloadAutoScalerProfileKeda `json:"keda,omitempty"` + VerticalPodAutoscaler *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler `json:"verticalPodAutoscaler,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go new file mode 100644 index 00000000000..7115a06bfb3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterWorkloadAutoScalerProfileKeda struct { + Enabled bool `json:"enabled"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go new file mode 100644 index 00000000000..baf9e23d43c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler struct { + Enabled bool `json:"enabled"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevision.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevision.go new file mode 100644 index 00000000000..e867a34a526 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevision.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MeshRevision struct { + CompatibleWith *[]CompatibleVersions `json:"compatibleWith,omitempty"` + Revision *string `json:"revision,omitempty"` + Upgrades *[]string `json:"upgrades,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofile.go new file mode 100644 index 00000000000..40b56bf28d8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofile.go @@ -0,0 +1,16 @@ +package managedclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MeshRevisionProfile struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MeshRevisionProfileProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofileproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofileproperties.go new file mode 100644 index 00000000000..4d72f23dadb --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshrevisionprofileproperties.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MeshRevisionProfileProperties struct { + MeshRevisions *[]MeshRevision `json:"meshRevisions,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_meshupgradeprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshupgradeprofile.go new file mode 100644 index 00000000000..804e24cc19b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_meshupgradeprofile.go @@ -0,0 +1,16 @@ +package managedclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MeshUpgradeProfile struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *MeshRevision `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_outboundenvironmentendpoint.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_outboundenvironmentendpoint.go new file mode 100644 index 00000000000..a4f0d234bc8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_outboundenvironmentendpoint.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OutboundEnvironmentEndpoint struct { + Category *string `json:"category,omitempty"` + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_portrange.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_portrange.go new file mode 100644 index 00000000000..0a44c59e9c8 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_portrange.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PortRange struct { + PortEnd *int64 `json:"portEnd,omitempty"` + PortStart *int64 `json:"portStart,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_powerstate.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_powerstate.go new file mode 100644 index 00000000000..d5abeb15b66 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_powerstate.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PowerState struct { + Code *Code `json:"code,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_privatelinkresource.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_privatelinkresource.go new file mode 100644 index 00000000000..14d827574be --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_privatelinkresource.go @@ -0,0 +1,13 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResource struct { + GroupId *string `json:"groupId,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"` + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_resourcereference.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_resourcereference.go new file mode 100644 index 00000000000..dbb05bb4711 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_resourcereference.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceReference struct { + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandrequest.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandrequest.go new file mode 100644 index 00000000000..caa9ae3d0cd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandrequest.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandRequest struct { + ClusterToken *string `json:"clusterToken,omitempty"` + Command string `json:"command"` + Context *string `json:"context,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandresult.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandresult.go new file mode 100644 index 00000000000..59cfc374de3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_runcommandresult.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RunCommandResult struct { + Id *string `json:"id,omitempty"` + Properties *CommandResultProperties `json:"properties,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_servicemeshprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_servicemeshprofile.go new file mode 100644 index 00000000000..781365d16f3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_servicemeshprofile.go @@ -0,0 +1,9 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceMeshProfile struct { + Istio *IstioServiceMesh `json:"istio,omitempty"` + Mode ServiceMeshMode `json:"mode"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_sysctlconfig.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_sysctlconfig.go new file mode 100644 index 00000000000..00f3cc50224 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_sysctlconfig.go @@ -0,0 +1,35 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SysctlConfig struct { + FsAioMaxNr *int64 `json:"fsAioMaxNr,omitempty"` + FsFileMax *int64 `json:"fsFileMax,omitempty"` + FsInotifyMaxUserWatches *int64 `json:"fsInotifyMaxUserWatches,omitempty"` + FsNrOpen *int64 `json:"fsNrOpen,omitempty"` + KernelThreadsMax *int64 `json:"kernelThreadsMax,omitempty"` + NetCoreNetdevMaxBacklog *int64 `json:"netCoreNetdevMaxBacklog,omitempty"` + NetCoreOptmemMax *int64 `json:"netCoreOptmemMax,omitempty"` + NetCoreRmemDefault *int64 `json:"netCoreRmemDefault,omitempty"` + NetCoreRmemMax *int64 `json:"netCoreRmemMax,omitempty"` + NetCoreSomaxconn *int64 `json:"netCoreSomaxconn,omitempty"` + NetCoreWmemDefault *int64 `json:"netCoreWmemDefault,omitempty"` + NetCoreWmemMax *int64 `json:"netCoreWmemMax,omitempty"` + NetIPv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"` + NetIPv4NeighDefaultGcThresh1 *int64 `json:"netIpv4NeighDefaultGcThresh1,omitempty"` + NetIPv4NeighDefaultGcThresh2 *int64 `json:"netIpv4NeighDefaultGcThresh2,omitempty"` + NetIPv4NeighDefaultGcThresh3 *int64 `json:"netIpv4NeighDefaultGcThresh3,omitempty"` + NetIPv4TcpFinTimeout *int64 `json:"netIpv4TcpFinTimeout,omitempty"` + NetIPv4TcpKeepaliveProbes *int64 `json:"netIpv4TcpKeepaliveProbes,omitempty"` + NetIPv4TcpKeepaliveTime *int64 `json:"netIpv4TcpKeepaliveTime,omitempty"` + NetIPv4TcpMaxSynBacklog *int64 `json:"netIpv4TcpMaxSynBacklog,omitempty"` + NetIPv4TcpMaxTwBuckets *int64 `json:"netIpv4TcpMaxTwBuckets,omitempty"` + NetIPv4TcpTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"` + NetIPv4TcpkeepaliveIntvl *int64 `json:"netIpv4TcpkeepaliveIntvl,omitempty"` + NetNetfilterNfConntrackBuckets *int64 `json:"netNetfilterNfConntrackBuckets,omitempty"` + NetNetfilterNfConntrackMax *int64 `json:"netNetfilterNfConntrackMax,omitempty"` + VMMaxMapCount *int64 `json:"vmMaxMapCount,omitempty"` + VMSwappiness *int64 `json:"vmSwappiness,omitempty"` + VMVfsCachePressure *int64 `json:"vmVfsCachePressure,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_tagsobject.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_tagsobject.go new file mode 100644 index 00000000000..69f1454e3b1 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_tagsobject.go @@ -0,0 +1,8 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TagsObject struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_upgradeoverridesettings.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_upgradeoverridesettings.go new file mode 100644 index 00000000000..6be73348ea0 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_upgradeoverridesettings.go @@ -0,0 +1,27 @@ +package managedclusters + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpgradeOverrideSettings struct { + ForceUpgrade *bool `json:"forceUpgrade,omitempty"` + Until *string `json:"until,omitempty"` +} + +func (o *UpgradeOverrideSettings) GetUntilAsTime() (*time.Time, error) { + if o.Until == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Until, "2006-01-02T15:04:05Z07:00") +} + +func (o *UpgradeOverrideSettings) SetUntilAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Until = &formatted +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfopatchproperties.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_userassignedidentity.go similarity index 57% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfopatchproperties.go rename to resource-manager/containerservice/2024-09-01/managedclusters/model_userassignedidentity.go index 8c5cf0148ad..b1eecd7085a 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_custominfopatchproperties.go +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_userassignedidentity.go @@ -1,8 +1,10 @@ -package sessionhostconfiguration +package managedclusters // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CustomInfoPatchProperties struct { +type UserAssignedIdentity struct { + ClientId *string `json:"clientId,omitempty"` + ObjectId *string `json:"objectId,omitempty"` ResourceId *string `json:"resourceId,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/model_windowsgmsaprofile.go b/resource-manager/containerservice/2024-09-01/managedclusters/model_windowsgmsaprofile.go new file mode 100644 index 00000000000..742f96764d4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/model_windowsgmsaprofile.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsGmsaProfile struct { + DnsServer *string `json:"dnsServer,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + RootDomainName *string `json:"rootDomainName,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/predicates.go b/resource-manager/containerservice/2024-09-01/managedclusters/predicates.go new file mode 100644 index 00000000000..3af85d2e142 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/predicates.go @@ -0,0 +1,96 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedClusterOperationPredicate struct { + ETag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p ManagedClusterOperationPredicate) Matches(input ManagedCluster) bool { + + if p.ETag != nil && (input.ETag == nil || *p.ETag != *input.ETag) { + return false + } + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type MeshRevisionProfileOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p MeshRevisionProfileOperationPredicate) Matches(input MeshRevisionProfile) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type MeshUpgradeProfileOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p MeshUpgradeProfileOperationPredicate) Matches(input MeshUpgradeProfile) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type OutboundEnvironmentEndpointOperationPredicate struct { + Category *string +} + +func (p OutboundEnvironmentEndpointOperationPredicate) Matches(input OutboundEnvironmentEndpoint) bool { + + if p.Category != nil && (input.Category == nil || *p.Category != *input.Category) { + return false + } + + return true +} diff --git a/resource-manager/containerservice/2024-09-01/managedclusters/version.go b/resource-manager/containerservice/2024-09-01/managedclusters/version.go new file mode 100644 index 00000000000..b76ed3da487 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/managedclusters/version.go @@ -0,0 +1,10 @@ +package managedclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/managedclusters/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/README.md b/resource-manager/containerservice/2024-09-01/privateendpointconnections/README.md new file mode 100644 index 00000000000..26a02e45559 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privateendpointconnections` Documentation + +The `privateendpointconnections` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privateendpointconnections" +``` + + +### Client Initialization + +```go +client := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.Get` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.List(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PrivateEndpointConnectionsClient.Update` + +```go +ctx := context.TODO() +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") + +payload := privateendpointconnections.PrivateEndpointConnection{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/client.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/client.go new file mode 100644 index 00000000000..50eaf09dcce --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/client.go @@ -0,0 +1,26 @@ +package privateendpointconnections + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionsClient struct { + Client *resourcemanager.Client +} + +func NewPrivateEndpointConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateEndpointConnectionsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "privateendpointconnections", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating PrivateEndpointConnectionsClient: %+v", err) + } + + return &PrivateEndpointConnectionsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/constants.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/constants.go new file mode 100644 index 00000000000..20cf74bcad4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/constants.go @@ -0,0 +1,107 @@ +package privateendpointconnections + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionStatus string + +const ( + ConnectionStatusApproved ConnectionStatus = "Approved" + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + ConnectionStatusPending ConnectionStatus = "Pending" + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +func PossibleValuesForConnectionStatus() []string { + return []string{ + string(ConnectionStatusApproved), + string(ConnectionStatusDisconnected), + string(ConnectionStatusPending), + string(ConnectionStatusRejected), + } +} + +func (s *ConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConnectionStatus(input string) (*ConnectionStatus, error) { + vals := map[string]ConnectionStatus{ + "approved": ConnectionStatusApproved, + "disconnected": ConnectionStatusDisconnected, + "pending": ConnectionStatusPending, + "rejected": ConnectionStatusRejected, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConnectionStatus(input) + return &out, nil +} + +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCanceled PrivateEndpointConnectionProvisioningState = "Canceled" + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { + return []string{ + string(PrivateEndpointConnectionProvisioningStateCanceled), + string(PrivateEndpointConnectionProvisioningStateCreating), + string(PrivateEndpointConnectionProvisioningStateDeleting), + string(PrivateEndpointConnectionProvisioningStateFailed), + string(PrivateEndpointConnectionProvisioningStateSucceeded), + } +} + +func (s *PrivateEndpointConnectionProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrivateEndpointConnectionProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePrivateEndpointConnectionProvisioningState(input string) (*PrivateEndpointConnectionProvisioningState, error) { + vals := map[string]PrivateEndpointConnectionProvisioningState{ + "canceled": PrivateEndpointConnectionProvisioningStateCanceled, + "creating": PrivateEndpointConnectionProvisioningStateCreating, + "deleting": PrivateEndpointConnectionProvisioningStateDeleting, + "failed": PrivateEndpointConnectionProvisioningStateFailed, + "succeeded": PrivateEndpointConnectionProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointConnectionProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection.go new file mode 100644 index 00000000000..383123bb5dc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection.go @@ -0,0 +1,139 @@ +package privateendpointconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&PrivateEndpointConnectionId{}) +} + +var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} + +// PrivateEndpointConnectionId is a struct representing the Resource ID for a Private Endpoint Connection +type PrivateEndpointConnectionId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + PrivateEndpointConnectionName string +} + +// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct +func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, managedClusterName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { + return PrivateEndpointConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + PrivateEndpointConnectionName: privateEndpointConnectionName, + } +} + +// ParsePrivateEndpointConnectionID parses 'input' into a PrivateEndpointConnectionId +func ParsePrivateEndpointConnectionID(input string) (*PrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := PrivateEndpointConnectionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParsePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a PrivateEndpointConnectionId +// note: this method should only be used for API response data and not user input +func ParsePrivateEndpointConnectionIDInsensitively(input string) (*PrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := PrivateEndpointConnectionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *PrivateEndpointConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) + } + + return nil +} + +// ValidatePrivateEndpointConnectionID checks that 'input' can be parsed as a Private Endpoint Connection ID +func ValidatePrivateEndpointConnectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParsePrivateEndpointConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/privateEndpointConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.PrivateEndpointConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), + } +} + +// String returns a human-readable description of this Private Endpoint Connection ID +func (id PrivateEndpointConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), + } + return fmt.Sprintf("Private Endpoint Connection (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection_test.go new file mode 100644 index 00000000000..f180a2cbb26 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -0,0 +1,327 @@ +package privateendpointconnections + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} + +func TestNewPrivateEndpointConnectionID(t *testing.T) { + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") + } +} + +func TestFormatPrivateEndpointConnectionID(t *testing.T) { + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParsePrivateEndpointConnectionID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *PrivateEndpointConnectionId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", + Expected: &PrivateEndpointConnectionId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParsePrivateEndpointConnectionID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { + t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) + } + + } +} + +func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *PrivateEndpointConnectionId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", + Expected: &PrivateEndpointConnectionId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Expected: &PrivateEndpointConnectionId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParsePrivateEndpointConnectionIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { + t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) + } + + } +} + +func TestSegmentsForPrivateEndpointConnectionId(t *testing.T) { + segments := PrivateEndpointConnectionId{}.Segments() + if len(segments) == 0 { + t.Fatalf("PrivateEndpointConnectionId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_delete.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_delete.go new file mode 100644 index 00000000000..2b9a343bdf0 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_delete.go @@ -0,0 +1,70 @@ +package privateendpointconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c PrivateEndpointConnectionsClient) Delete(ctx context.Context, id PrivateEndpointConnectionId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c PrivateEndpointConnectionsClient) DeleteThenPoll(ctx context.Context, id PrivateEndpointConnectionId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_get.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_get.go new file mode 100644 index 00000000000..351242746d4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_get.go @@ -0,0 +1,53 @@ +package privateendpointconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateEndpointConnection +} + +// Get ... +func (c PrivateEndpointConnectionsClient) Get(ctx context.Context, id PrivateEndpointConnectionId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model PrivateEndpointConnection + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_list.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_list.go new file mode 100644 index 00000000000..1ed7cfe4cf6 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_list.go @@ -0,0 +1,55 @@ +package privateendpointconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateEndpointConnectionListResult +} + +// List ... +func (c PrivateEndpointConnectionsClient) List(ctx context.Context, id commonids.KubernetesClusterId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateEndpointConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model PrivateEndpointConnectionListResult + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_update.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_update.go similarity index 71% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_update.go rename to resource-manager/containerservice/2024-09-01/privateendpointconnections/method_update.go index fec3bb9a2ab..12c2adf4c15 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_update.go +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/method_update.go @@ -1,8 +1,7 @@ -package sessionhostmanagement +package privateendpointconnections import ( "context" - "fmt" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -15,18 +14,19 @@ import ( type UpdateOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *SessionHostManagement + Model *PrivateEndpointConnection } // Update ... -func (c SessionHostManagementClient) Update(ctx context.Context, id HostPoolId, input SessionHostManagementPatch) (result UpdateOperationResponse, err error) { +func (c PrivateEndpointConnectionsClient) Update(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result UpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ + http.StatusCreated, http.StatusOK, }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/sessionHostManagements/default", id.ID()), + HttpMethod: http.MethodPut, + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -48,7 +48,7 @@ func (c SessionHostManagementClient) Update(ctx context.Context, id HostPoolId, return } - var model SessionHostManagement + var model PrivateEndpointConnection result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpoint.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpoint.go new file mode 100644 index 00000000000..1bc8cf2a97c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpoint.go @@ -0,0 +1,8 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnection.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnection.go new file mode 100644 index 00000000000..fde7f4db0fc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnection.go @@ -0,0 +1,11 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionlistresult.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionlistresult.go new file mode 100644 index 00000000000..92a9ecb105a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionlistresult.go @@ -0,0 +1,8 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionListResult struct { + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..549d255f069 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState"` + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go new file mode 100644 index 00000000000..677cab99f90 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/model_privatelinkserviceconnectionstate.go @@ -0,0 +1,9 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionState struct { + Description *string `json:"description,omitempty"` + Status *ConnectionStatus `json:"status,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privateendpointconnections/version.go b/resource-manager/containerservice/2024-09-01/privateendpointconnections/version.go new file mode 100644 index 00000000000..6777b8e376f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privateendpointconnections/version.go @@ -0,0 +1,10 @@ +package privateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/privateendpointconnections/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/README.md b/resource-manager/containerservice/2024-09-01/privatelinkresources/README.md new file mode 100644 index 00000000000..d3d2240a8d3 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privatelinkresources` Documentation + +The `privatelinkresources` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/privatelinkresources" +``` + + +### Client Initialization + +```go +client := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateLinkResourcesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +read, err := client.List(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/client.go b/resource-manager/containerservice/2024-09-01/privatelinkresources/client.go new file mode 100644 index 00000000000..28c00b21f03 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/client.go @@ -0,0 +1,26 @@ +package privatelinkresources + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourcesClient struct { + Client *resourcemanager.Client +} + +func NewPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkResourcesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "privatelinkresources", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating PrivateLinkResourcesClient: %+v", err) + } + + return &PrivateLinkResourcesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/method_list.go b/resource-manager/containerservice/2024-09-01/privatelinkresources/method_list.go new file mode 100644 index 00000000000..905a02fa803 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/method_list.go @@ -0,0 +1,55 @@ +package privatelinkresources + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateLinkResourcesListResult +} + +// List ... +func (c PrivateLinkResourcesClient) List(ctx context.Context, id commonids.KubernetesClusterId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateLinkResources", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model PrivateLinkResourcesListResult + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresource.go b/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresource.go new file mode 100644 index 00000000000..3490b3d4e87 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresource.go @@ -0,0 +1,13 @@ +package privatelinkresources + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResource struct { + GroupId *string `json:"groupId,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"` + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresourceslistresult.go b/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresourceslistresult.go new file mode 100644 index 00000000000..52cfe88b6e2 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/model_privatelinkresourceslistresult.go @@ -0,0 +1,8 @@ +package privatelinkresources + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourcesListResult struct { + Value *[]PrivateLinkResource `json:"value,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/privatelinkresources/version.go b/resource-manager/containerservice/2024-09-01/privatelinkresources/version.go new file mode 100644 index 00000000000..1ab84de3b26 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/privatelinkresources/version.go @@ -0,0 +1,10 @@ +package privatelinkresources + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/privatelinkresources/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/README.md b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/README.md new file mode 100644 index 00000000000..c94cb5ecb31 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/README.md @@ -0,0 +1,42 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid` Documentation + +The `resolveprivatelinkserviceid` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid" +``` + + +### Client Initialization + +```go +client := resolveprivatelinkserviceid.NewResolvePrivateLinkServiceIdClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ResolvePrivateLinkServiceIdClient.POST` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +payload := resolveprivatelinkserviceid.PrivateLinkResource{ + // ... +} + + +read, err := client.POST(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/client.go b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/client.go new file mode 100644 index 00000000000..5682fe91725 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/client.go @@ -0,0 +1,26 @@ +package resolveprivatelinkserviceid + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResolvePrivateLinkServiceIdClient struct { + Client *resourcemanager.Client +} + +func NewResolvePrivateLinkServiceIdClientWithBaseURI(sdkApi sdkEnv.Api) (*ResolvePrivateLinkServiceIdClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "resolveprivatelinkserviceid", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ResolvePrivateLinkServiceIdClient: %+v", err) + } + + return &ResolvePrivateLinkServiceIdClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/method_post.go b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/method_post.go new file mode 100644 index 00000000000..de55fb54ccc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/method_post.go @@ -0,0 +1,59 @@ +package resolveprivatelinkserviceid + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type POSTOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateLinkResource +} + +// POST ... +func (c ResolvePrivateLinkServiceIdClient) POST(ctx context.Context, id commonids.KubernetesClusterId, input PrivateLinkResource) (result POSTOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resolvePrivateLinkServiceId", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model PrivateLinkResource + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/model_privatelinkresource.go b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/model_privatelinkresource.go new file mode 100644 index 00000000000..4ff07dba897 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/model_privatelinkresource.go @@ -0,0 +1,13 @@ +package resolveprivatelinkserviceid + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResource struct { + GroupId *string `json:"groupId,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"` + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/version.go b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/version.go new file mode 100644 index 00000000000..ff6b8cbf5be --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/resolveprivatelinkserviceid/version.go @@ -0,0 +1,10 @@ +package resolveprivatelinkserviceid + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/resolveprivatelinkserviceid/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/README.md b/resource-manager/containerservice/2024-09-01/snapshots/README.md new file mode 100644 index 00000000000..2c8c5fb78cc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/README.md @@ -0,0 +1,129 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/snapshots` Documentation + +The `snapshots` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/snapshots" +``` + + +### Client Initialization + +```go +client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") + +payload := snapshots.Snapshot{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.Delete` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.Get` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `SnapshotsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `SnapshotsClient.UpdateTags` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") + +payload := snapshots.TagsObject{ + // ... +} + + +read, err := client.UpdateTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/containerservice/2024-09-01/snapshots/client.go b/resource-manager/containerservice/2024-09-01/snapshots/client.go new file mode 100644 index 00000000000..678a64470aa --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/client.go @@ -0,0 +1,26 @@ +package snapshots + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotsClient struct { + Client *resourcemanager.Client +} + +func NewSnapshotsClientWithBaseURI(sdkApi sdkEnv.Api) (*SnapshotsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "snapshots", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SnapshotsClient: %+v", err) + } + + return &SnapshotsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/constants.go b/resource-manager/containerservice/2024-09-01/snapshots/constants.go new file mode 100644 index 00000000000..f8683c860fd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/constants.go @@ -0,0 +1,139 @@ +package snapshots + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OSSKU string + +const ( + OSSKUAzureLinux OSSKU = "AzureLinux" + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUUbuntu OSSKU = "Ubuntu" + OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" + OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" +) + +func PossibleValuesForOSSKU() []string { + return []string{ + string(OSSKUAzureLinux), + string(OSSKUCBLMariner), + string(OSSKUUbuntu), + string(OSSKUWindowsTwoZeroOneNine), + string(OSSKUWindowsTwoZeroTwoTwo), + } +} + +func (s *OSSKU) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSSKU(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSSKU(input string) (*OSSKU, error) { + vals := map[string]OSSKU{ + "azurelinux": OSSKUAzureLinux, + "cblmariner": OSSKUCBLMariner, + "ubuntu": OSSKUUbuntu, + "windows2019": OSSKUWindowsTwoZeroOneNine, + "windows2022": OSSKUWindowsTwoZeroTwoTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSSKU(input) + return &out, nil +} + +type OSType string + +const ( + OSTypeLinux OSType = "Linux" + OSTypeWindows OSType = "Windows" +) + +func PossibleValuesForOSType() []string { + return []string{ + string(OSTypeLinux), + string(OSTypeWindows), + } +} + +func (s *OSType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSType(input string) (*OSType, error) { + vals := map[string]OSType{ + "linux": OSTypeLinux, + "windows": OSTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSType(input) + return &out, nil +} + +type SnapshotType string + +const ( + SnapshotTypeNodePool SnapshotType = "NodePool" +) + +func PossibleValuesForSnapshotType() []string { + return []string{ + string(SnapshotTypeNodePool), + } +} + +func (s *SnapshotType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSnapshotType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSnapshotType(input string) (*SnapshotType, error) { + vals := map[string]SnapshotType{ + "nodepool": SnapshotTypeNodePool, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SnapshotType(input) + return &out, nil +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool.go b/resource-manager/containerservice/2024-09-01/snapshots/id_snapshot.go similarity index 54% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool.go rename to resource-manager/containerservice/2024-09-01/snapshots/id_snapshot.go index 589253a439b..8081e44fc0b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool.go +++ b/resource-manager/containerservice/2024-09-01/snapshots/id_snapshot.go @@ -1,4 +1,4 @@ -package sessionhostmanagement +package snapshots import ( "fmt" @@ -12,36 +12,36 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&HostPoolId{}) + recaser.RegisterResourceId(&SnapshotId{}) } -var _ resourceids.ResourceId = &HostPoolId{} +var _ resourceids.ResourceId = &SnapshotId{} -// HostPoolId is a struct representing the Resource ID for a Host Pool -type HostPoolId struct { +// SnapshotId is a struct representing the Resource ID for a Snapshot +type SnapshotId struct { SubscriptionId string ResourceGroupName string - HostPoolName string + SnapshotName string } -// NewHostPoolID returns a new HostPoolId struct -func NewHostPoolID(subscriptionId string, resourceGroupName string, hostPoolName string) HostPoolId { - return HostPoolId{ +// NewSnapshotID returns a new SnapshotId struct +func NewSnapshotID(subscriptionId string, resourceGroupName string, snapshotName string) SnapshotId { + return SnapshotId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, - HostPoolName: hostPoolName, + SnapshotName: snapshotName, } } -// ParseHostPoolID parses 'input' into a HostPoolId -func ParseHostPoolID(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) +// ParseSnapshotID parses 'input' into a SnapshotId +func ParseSnapshotID(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := HostPoolId{} + id := SnapshotId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -49,16 +49,16 @@ func ParseHostPoolID(input string) (*HostPoolId, error) { return &id, nil } -// ParseHostPoolIDInsensitively parses 'input' case-insensitively into a HostPoolId +// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId // note: this method should only be used for API response data and not user input -func ParseHostPoolIDInsensitively(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) +func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := HostPoolId{} + id := SnapshotId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -66,7 +66,7 @@ func ParseHostPoolIDInsensitively(input string) (*HostPoolId, error) { return &id, nil } -func (id *HostPoolId) FromParseResult(input resourceids.ParseResult) error { +func (id *SnapshotId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -77,54 +77,54 @@ func (id *HostPoolId) FromParseResult(input resourceids.ParseResult) error { return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) } - if id.HostPoolName, ok = input.Parsed["hostPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hostPoolName", input) + if id.SnapshotName, ok = input.Parsed["snapshotName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "snapshotName", input) } return nil } -// ValidateHostPoolID checks that 'input' can be parsed as a Host Pool ID -func ValidateHostPoolID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID +func ValidateSnapshotID(input interface{}, key string) (warnings []string, errors []error) { v, ok := input.(string) if !ok { errors = append(errors, fmt.Errorf("expected %q to be a string", key)) return } - if _, err := ParseHostPoolID(v); err != nil { + if _, err := ParseSnapshotID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Host Pool ID -func (id HostPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DesktopVirtualization/hostPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostPoolName) +// ID returns the formatted Snapshot ID +func (id SnapshotId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/snapshots/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SnapshotName) } -// Segments returns a slice of Resource ID Segments which comprise this Host Pool ID -func (id HostPoolId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Snapshot ID +func (id SnapshotId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftDesktopVirtualization", "Microsoft.DesktopVirtualization", "Microsoft.DesktopVirtualization"), - resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), - resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotName"), } } -// String returns a human-readable description of this Host Pool ID -func (id HostPoolId) String() string { +// String returns a human-readable description of this Snapshot ID +func (id SnapshotId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Host Pool Name: %q", id.HostPoolName), + fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), } - return fmt.Sprintf("Host Pool (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool_test.go b/resource-manager/containerservice/2024-09-01/snapshots/id_snapshot_test.go similarity index 71% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool_test.go rename to resource-manager/containerservice/2024-09-01/snapshots/id_snapshot_test.go index 75b187c09d0..67f5a402cf0 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/id_hostpool_test.go +++ b/resource-manager/containerservice/2024-09-01/snapshots/id_snapshot_test.go @@ -1,4 +1,4 @@ -package sessionhostmanagement +package snapshots import ( "testing" @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &HostPoolId{} +var _ resourceids.ResourceId = &SnapshotId{} -func TestNewHostPoolID(t *testing.T) { - id := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") +func TestNewSnapshotID(t *testing.T) { + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,24 +22,24 @@ func TestNewHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostPoolName != "hostPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") + if id.SnapshotName != "snapshotName" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotName") } } -func TestFormatHostPoolID(t *testing.T) { - actual := NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName" +func TestFormatSnapshotID(t *testing.T) { + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseHostPoolID(t *testing.T) { +func TestParseSnapshotID(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *SnapshotId }{ { // Incomplete URI @@ -73,33 +73,33 @@ func TestParseHostPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", + Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolID(v.Input) + actual, err := ParseSnapshotID(v.Input) if err != nil { if v.Error { continue @@ -119,18 +119,18 @@ func TestParseHostPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.SnapshotName != v.Expected.SnapshotName { + t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) } } } -func TestParseHostPoolIDInsensitively(t *testing.T) { +func TestParseSnapshotIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *HostPoolId + Expected *SnapshotId }{ { // Incomplete URI @@ -189,57 +189,57 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName", - Expected: &HostPoolId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", + Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostPoolName: "hostPoolName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE", - Expected: &HostPoolId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE", + Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostPoolName: "hOsTpOoLnAmE", + SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseHostPoolIDInsensitively(v.Input) + actual, err := ParseSnapshotIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -259,17 +259,17 @@ func TestParseHostPoolIDInsensitively(t *testing.T) { t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) } - if actual.HostPoolName != v.Expected.HostPoolName { - t.Fatalf("Expected %q but got %q for HostPoolName", v.Expected.HostPoolName, actual.HostPoolName) + if actual.SnapshotName != v.Expected.SnapshotName { + t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) } } } -func TestSegmentsForHostPoolId(t *testing.T) { - segments := HostPoolId{}.Segments() +func TestSegmentsForSnapshotId(t *testing.T) { + segments := SnapshotId{}.Segments() if len(segments) == 0 { - t.Fatalf("HostPoolId has no segments") + t.Fatalf("SnapshotId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_createorupdate.go b/resource-manager/containerservice/2024-09-01/snapshots/method_createorupdate.go new file mode 100644 index 00000000000..2085af2f95b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_createorupdate.go @@ -0,0 +1,58 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Snapshot +} + +// CreateOrUpdate ... +func (c SnapshotsClient) CreateOrUpdate(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model Snapshot + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_delete.go b/resource-manager/containerservice/2024-09-01/snapshots/method_delete.go new file mode 100644 index 00000000000..575cb8a6929 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_delete.go @@ -0,0 +1,47 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_get.go b/resource-manager/containerservice/2024-09-01/snapshots/method_get.go new file mode 100644 index 00000000000..68b676f0115 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_get.go @@ -0,0 +1,53 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Snapshot +} + +// Get ... +func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model Snapshot + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_list.go b/resource-manager/containerservice/2024-09-01/snapshots/method_list.go new file mode 100644 index 00000000000..340f60c09b1 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_list.go @@ -0,0 +1,106 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Snapshot +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Snapshot +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c SnapshotsClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/snapshots", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Snapshot `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c SnapshotsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, SnapshotOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SnapshotsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SnapshotOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Snapshot, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_listbyresourcegroup.go b/resource-manager/containerservice/2024-09-01/snapshots/method_listbyresourcegroup.go new file mode 100644 index 00000000000..fb276c706e9 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Snapshot +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []Snapshot +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c SnapshotsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/snapshots", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Snapshot `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, SnapshotOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SnapshotsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate SnapshotOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Snapshot, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/method_updatetags.go b/resource-manager/containerservice/2024-09-01/snapshots/method_updatetags.go new file mode 100644 index 00000000000..86fd5d87f00 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/method_updatetags.go @@ -0,0 +1,57 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateTagsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Snapshot +} + +// UpdateTags ... +func (c SnapshotsClient) UpdateTags(ctx context.Context, id SnapshotId, input TagsObject) (result UpdateTagsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model Snapshot + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/model_creationdata.go b/resource-manager/containerservice/2024-09-01/snapshots/model_creationdata.go new file mode 100644 index 00000000000..132e3459c82 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/model_creationdata.go @@ -0,0 +1,8 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreationData struct { + SourceResourceId *string `json:"sourceResourceId,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/model_snapshot.go b/resource-manager/containerservice/2024-09-01/snapshots/model_snapshot.go new file mode 100644 index 00000000000..b2feb4ccdae --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/model_snapshot.go @@ -0,0 +1,18 @@ +package snapshots + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Snapshot struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *SnapshotProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/model_snapshotproperties.go b/resource-manager/containerservice/2024-09-01/snapshots/model_snapshotproperties.go new file mode 100644 index 00000000000..962aa32598f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/model_snapshotproperties.go @@ -0,0 +1,15 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotProperties struct { + CreationData *CreationData `json:"creationData,omitempty"` + EnableFIPS *bool `json:"enableFIPS,omitempty"` + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + OsSku *OSSKU `json:"osSku,omitempty"` + OsType *OSType `json:"osType,omitempty"` + SnapshotType *SnapshotType `json:"snapshotType,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/model_tagsobject.go b/resource-manager/containerservice/2024-09-01/snapshots/model_tagsobject.go new file mode 100644 index 00000000000..30f646c1c9f --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/model_tagsobject.go @@ -0,0 +1,8 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TagsObject struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/predicates.go b/resource-manager/containerservice/2024-09-01/snapshots/predicates.go new file mode 100644 index 00000000000..832503e3b26 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/predicates.go @@ -0,0 +1,32 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p SnapshotOperationPredicate) Matches(input Snapshot) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/resource-manager/containerservice/2024-09-01/snapshots/version.go b/resource-manager/containerservice/2024-09-01/snapshots/version.go new file mode 100644 index 00000000000..b6c91043af2 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/snapshots/version.go @@ -0,0 +1,10 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/snapshots/2024-09-01" +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/README.md b/resource-manager/containerservice/2024-09-01/trustedaccess/README.md new file mode 100644 index 00000000000..61b92913883 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/README.md @@ -0,0 +1,100 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/trustedaccess` Documentation + +The `trustedaccess` SDK allows for interaction with Azure Resource Manager `containerservice` (API Version `2024-09-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-09-01/trustedaccess" +``` + + +### Client Initialization + +```go +client := trustedaccess.NewTrustedAccessClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TrustedAccessClient.RoleBindingsCreateOrUpdate` + +```go +ctx := context.TODO() +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") + +payload := trustedaccess.TrustedAccessRoleBinding{ + // ... +} + + +if err := client.RoleBindingsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `TrustedAccessClient.RoleBindingsDelete` + +```go +ctx := context.TODO() +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") + +if err := client.RoleBindingsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `TrustedAccessClient.RoleBindingsGet` + +```go +ctx := context.TODO() +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") + +read, err := client.RoleBindingsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `TrustedAccessClient.RoleBindingsList` + +```go +ctx := context.TODO() +id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") + +// alternatively `client.RoleBindingsList(ctx, id)` can be used to do batched pagination +items, err := client.RoleBindingsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `TrustedAccessClient.RolesList` + +```go +ctx := context.TODO() +id := trustedaccess.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.RolesList(ctx, id)` can be used to do batched pagination +items, err := client.RolesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/client.go b/resource-manager/containerservice/2024-09-01/trustedaccess/client.go new file mode 100644 index 00000000000..e3e1d5a54e4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/client.go @@ -0,0 +1,26 @@ +package trustedaccess + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessClient struct { + Client *resourcemanager.Client +} + +func NewTrustedAccessClientWithBaseURI(sdkApi sdkEnv.Api) (*TrustedAccessClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "trustedaccess", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating TrustedAccessClient: %+v", err) + } + + return &TrustedAccessClient{ + Client: client, + }, nil +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/constants.go b/resource-manager/containerservice/2024-09-01/trustedaccess/constants.go new file mode 100644 index 00000000000..8ab993f971c --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/constants.go @@ -0,0 +1,60 @@ +package trustedaccess + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessRoleBindingProvisioningState string + +const ( + TrustedAccessRoleBindingProvisioningStateCanceled TrustedAccessRoleBindingProvisioningState = "Canceled" + TrustedAccessRoleBindingProvisioningStateDeleting TrustedAccessRoleBindingProvisioningState = "Deleting" + TrustedAccessRoleBindingProvisioningStateFailed TrustedAccessRoleBindingProvisioningState = "Failed" + TrustedAccessRoleBindingProvisioningStateSucceeded TrustedAccessRoleBindingProvisioningState = "Succeeded" + TrustedAccessRoleBindingProvisioningStateUpdating TrustedAccessRoleBindingProvisioningState = "Updating" +) + +func PossibleValuesForTrustedAccessRoleBindingProvisioningState() []string { + return []string{ + string(TrustedAccessRoleBindingProvisioningStateCanceled), + string(TrustedAccessRoleBindingProvisioningStateDeleting), + string(TrustedAccessRoleBindingProvisioningStateFailed), + string(TrustedAccessRoleBindingProvisioningStateSucceeded), + string(TrustedAccessRoleBindingProvisioningStateUpdating), + } +} + +func (s *TrustedAccessRoleBindingProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTrustedAccessRoleBindingProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTrustedAccessRoleBindingProvisioningState(input string) (*TrustedAccessRoleBindingProvisioningState, error) { + vals := map[string]TrustedAccessRoleBindingProvisioningState{ + "canceled": TrustedAccessRoleBindingProvisioningStateCanceled, + "deleting": TrustedAccessRoleBindingProvisioningStateDeleting, + "failed": TrustedAccessRoleBindingProvisioningStateFailed, + "succeeded": TrustedAccessRoleBindingProvisioningStateSucceeded, + "updating": TrustedAccessRoleBindingProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TrustedAccessRoleBindingProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/id_location.go b/resource-manager/containerservice/2024-09-01/trustedaccess/id_location.go new file mode 100644 index 00000000000..9372d26414b --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/id_location.go @@ -0,0 +1,121 @@ +package trustedaccess + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) + } + + return nil +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.ContainerService/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/id_location_test.go b/resource-manager/containerservice/2024-09-01/trustedaccess/id_location_test.go new file mode 100644 index 00000000000..d75d02aa0b9 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/id_location_test.go @@ -0,0 +1,237 @@ +package trustedaccess + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &LocationId{} + +func TestNewLocationID(t *testing.T) { + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") + } +} + +func TestFormatLocationID(t *testing.T) { + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseLocationID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + } +} + +func TestParseLocationIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNnAmE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + } +} + +func TestSegmentsForLocationId(t *testing.T) { + segments := LocationId{}.Segments() + if len(segments) == 0 { + t.Fatalf("LocationId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding.go b/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding.go new file mode 100644 index 00000000000..e53842f1ccd --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding.go @@ -0,0 +1,139 @@ +package trustedaccess + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&TrustedAccessRoleBindingId{}) +} + +var _ resourceids.ResourceId = &TrustedAccessRoleBindingId{} + +// TrustedAccessRoleBindingId is a struct representing the Resource ID for a Trusted Access Role Binding +type TrustedAccessRoleBindingId struct { + SubscriptionId string + ResourceGroupName string + ManagedClusterName string + TrustedAccessRoleBindingName string +} + +// NewTrustedAccessRoleBindingID returns a new TrustedAccessRoleBindingId struct +func NewTrustedAccessRoleBindingID(subscriptionId string, resourceGroupName string, managedClusterName string, trustedAccessRoleBindingName string) TrustedAccessRoleBindingId { + return TrustedAccessRoleBindingId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ManagedClusterName: managedClusterName, + TrustedAccessRoleBindingName: trustedAccessRoleBindingName, + } +} + +// ParseTrustedAccessRoleBindingID parses 'input' into a TrustedAccessRoleBindingId +func ParseTrustedAccessRoleBindingID(input string) (*TrustedAccessRoleBindingId, error) { + parser := resourceids.NewParserFromResourceIdType(&TrustedAccessRoleBindingId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := TrustedAccessRoleBindingId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseTrustedAccessRoleBindingIDInsensitively parses 'input' case-insensitively into a TrustedAccessRoleBindingId +// note: this method should only be used for API response data and not user input +func ParseTrustedAccessRoleBindingIDInsensitively(input string) (*TrustedAccessRoleBindingId, error) { + parser := resourceids.NewParserFromResourceIdType(&TrustedAccessRoleBindingId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := TrustedAccessRoleBindingId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *TrustedAccessRoleBindingId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ManagedClusterName, ok = input.Parsed["managedClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterName", input) + } + + if id.TrustedAccessRoleBindingName, ok = input.Parsed["trustedAccessRoleBindingName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "trustedAccessRoleBindingName", input) + } + + return nil +} + +// ValidateTrustedAccessRoleBindingID checks that 'input' can be parsed as a Trusted Access Role Binding ID +func ValidateTrustedAccessRoleBindingID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseTrustedAccessRoleBindingID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Trusted Access Role Binding ID +func (id TrustedAccessRoleBindingId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusters/%s/trustedAccessRoleBindings/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterName, id.TrustedAccessRoleBindingName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Trusted Access Role Binding ID +func (id TrustedAccessRoleBindingId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), + resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), + resourceids.StaticSegment("staticTrustedAccessRoleBindings", "trustedAccessRoleBindings", "trustedAccessRoleBindings"), + resourceids.UserSpecifiedSegment("trustedAccessRoleBindingName", "trustedAccessRoleBindingName"), + } +} + +// String returns a human-readable description of this Trusted Access Role Binding ID +func (id TrustedAccessRoleBindingId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Managed Cluster Name: %q", id.ManagedClusterName), + fmt.Sprintf("Trusted Access Role Binding Name: %q", id.TrustedAccessRoleBindingName), + } + return fmt.Sprintf("Trusted Access Role Binding (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding_test.go b/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding_test.go new file mode 100644 index 00000000000..bea546caaef --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/id_trustedaccessrolebinding_test.go @@ -0,0 +1,327 @@ +package trustedaccess + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &TrustedAccessRoleBindingId{} + +func TestNewTrustedAccessRoleBindingID(t *testing.T) { + id := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") + } + + if id.TrustedAccessRoleBindingName != "trustedAccessRoleBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'TrustedAccessRoleBindingName'", id.TrustedAccessRoleBindingName, "trustedAccessRoleBindingName") + } +} + +func TestFormatTrustedAccessRoleBindingID(t *testing.T) { + actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseTrustedAccessRoleBindingID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *TrustedAccessRoleBindingId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Expected: &TrustedAccessRoleBindingId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseTrustedAccessRoleBindingID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.TrustedAccessRoleBindingName != v.Expected.TrustedAccessRoleBindingName { + t.Fatalf("Expected %q but got %q for TrustedAccessRoleBindingName", v.Expected.TrustedAccessRoleBindingName, actual.TrustedAccessRoleBindingName) + } + + } +} + +func TestParseTrustedAccessRoleBindingIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *TrustedAccessRoleBindingId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Expected: &TrustedAccessRoleBindingId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ManagedClusterName: "managedClusterName", + TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE", + Expected: &TrustedAccessRoleBindingId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + TrustedAccessRoleBindingName: "tRuStEdAcCeSsRoLeBiNdInGnAmE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseTrustedAccessRoleBindingIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ManagedClusterName != v.Expected.ManagedClusterName { + t.Fatalf("Expected %q but got %q for ManagedClusterName", v.Expected.ManagedClusterName, actual.ManagedClusterName) + } + + if actual.TrustedAccessRoleBindingName != v.Expected.TrustedAccessRoleBindingName { + t.Fatalf("Expected %q but got %q for TrustedAccessRoleBindingName", v.Expected.TrustedAccessRoleBindingName, actual.TrustedAccessRoleBindingName) + } + + } +} + +func TestSegmentsForTrustedAccessRoleBindingId(t *testing.T) { + segments := TrustedAccessRoleBindingId{}.Segments() + if len(segments) == 0 { + t.Fatalf("TrustedAccessRoleBindingId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_createorupdate.go b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingscreateorupdate.go similarity index 58% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_createorupdate.go rename to resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingscreateorupdate.go index 34d0df2bef0..682a9388eae 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_createorupdate.go +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingscreateorupdate.go @@ -1,4 +1,4 @@ -package sessionhostconfiguration +package trustedaccess import ( "context" @@ -14,15 +14,15 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CreateOrUpdateOperationResponse struct { +type RoleBindingsCreateOrUpdateOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *SessionHostConfiguration + Model *TrustedAccessRoleBinding } -// CreateOrUpdate ... -func (c SessionHostConfigurationClient) CreateOrUpdate(ctx context.Context, id HostPoolId, input SessionHostConfiguration) (result CreateOrUpdateOperationResponse, err error) { +// RoleBindingsCreateOrUpdate ... +func (c TrustedAccessClient) RoleBindingsCreateOrUpdate(ctx context.Context, id TrustedAccessRoleBindingId, input TrustedAccessRoleBinding) (result RoleBindingsCreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -30,7 +30,7 @@ func (c SessionHostConfigurationClient) CreateOrUpdate(ctx context.Context, id H http.StatusOK, }, HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/sessionHostConfigurations/default", id.ID()), + Path: id.ID(), } req, err := c.Client.NewRequest(ctx, opts) @@ -60,15 +60,15 @@ func (c SessionHostConfigurationClient) CreateOrUpdate(ctx context.Context, id H return } -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SessionHostConfigurationClient) CreateOrUpdateThenPoll(ctx context.Context, id HostPoolId, input SessionHostConfiguration) error { - result, err := c.CreateOrUpdate(ctx, id, input) +// RoleBindingsCreateOrUpdateThenPoll performs RoleBindingsCreateOrUpdate then polls until it's completed +func (c TrustedAccessClient) RoleBindingsCreateOrUpdateThenPoll(ctx context.Context, id TrustedAccessRoleBindingId, input TrustedAccessRoleBinding) error { + result, err := c.RoleBindingsCreateOrUpdate(ctx, id, input) if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) + return fmt.Errorf("performing RoleBindingsCreateOrUpdate: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + return fmt.Errorf("polling after RoleBindingsCreateOrUpdate: %+v", err) } return nil diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsdelete.go b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsdelete.go new file mode 100644 index 00000000000..7107d14f6f5 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsdelete.go @@ -0,0 +1,70 @@ +package trustedaccess + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RoleBindingsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RoleBindingsDelete ... +func (c TrustedAccessClient) RoleBindingsDelete(ctx context.Context, id TrustedAccessRoleBindingId) (result RoleBindingsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RoleBindingsDeleteThenPoll performs RoleBindingsDelete then polls until it's completed +func (c TrustedAccessClient) RoleBindingsDeleteThenPoll(ctx context.Context, id TrustedAccessRoleBindingId) error { + result, err := c.RoleBindingsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing RoleBindingsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RoleBindingsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsget.go b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsget.go new file mode 100644 index 00000000000..d70aa4cbfb4 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingsget.go @@ -0,0 +1,53 @@ +package trustedaccess + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RoleBindingsGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *TrustedAccessRoleBinding +} + +// RoleBindingsGet ... +func (c TrustedAccessClient) RoleBindingsGet(ctx context.Context, id TrustedAccessRoleBindingId) (result RoleBindingsGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model TrustedAccessRoleBinding + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingslist.go b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingslist.go new file mode 100644 index 00000000000..8c24b744a5d --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/method_rolebindingslist.go @@ -0,0 +1,106 @@ +package trustedaccess + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RoleBindingsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]TrustedAccessRoleBinding +} + +type RoleBindingsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []TrustedAccessRoleBinding +} + +type RoleBindingsListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *RoleBindingsListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// RoleBindingsList ... +func (c TrustedAccessClient) RoleBindingsList(ctx context.Context, id commonids.KubernetesClusterId) (result RoleBindingsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &RoleBindingsListCustomPager{}, + Path: fmt.Sprintf("%s/trustedAccessRoleBindings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]TrustedAccessRoleBinding `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// RoleBindingsListComplete retrieves all the results into a single object +func (c TrustedAccessClient) RoleBindingsListComplete(ctx context.Context, id commonids.KubernetesClusterId) (RoleBindingsListCompleteResult, error) { + return c.RoleBindingsListCompleteMatchingPredicate(ctx, id, TrustedAccessRoleBindingOperationPredicate{}) +} + +// RoleBindingsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c TrustedAccessClient) RoleBindingsListCompleteMatchingPredicate(ctx context.Context, id commonids.KubernetesClusterId, predicate TrustedAccessRoleBindingOperationPredicate) (result RoleBindingsListCompleteResult, err error) { + items := make([]TrustedAccessRoleBinding, 0) + + resp, err := c.RoleBindingsList(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = RoleBindingsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_listbyhostpool.go b/resource-manager/containerservice/2024-09-01/trustedaccess/method_roleslist.go similarity index 50% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_listbyhostpool.go rename to resource-manager/containerservice/2024-09-01/trustedaccess/method_roleslist.go index 24cc3db7e0b..211cbf901bc 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/method_listbyhostpool.go +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/method_roleslist.go @@ -1,4 +1,4 @@ -package sessionhostmanagements +package trustedaccess import ( "context" @@ -12,22 +12,22 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListByHostPoolOperationResponse struct { +type RolesListOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]SessionHostManagement + Model *[]TrustedAccessRole } -type ListByHostPoolCompleteResult struct { +type RolesListCompleteResult struct { LatestHttpResponse *http.Response - Items []SessionHostManagement + Items []TrustedAccessRole } -type ListByHostPoolCustomPager struct { +type RolesListCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListByHostPoolCustomPager) NextPageLink() *odata.Link { +func (p *RolesListCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -35,16 +35,16 @@ func (p *ListByHostPoolCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListByHostPool ... -func (c SessionHostManagementsClient) ListByHostPool(ctx context.Context, id HostPoolId) (result ListByHostPoolOperationResponse, err error) { +// RolesList ... +func (c TrustedAccessClient) RolesList(ctx context.Context, id LocationId) (result RolesListOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Pager: &ListByHostPoolCustomPager{}, - Path: fmt.Sprintf("%s/sessionHostManagements", id.ID()), + Pager: &RolesListCustomPager{}, + Path: fmt.Sprintf("%s/trustedAccessRoles", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) @@ -63,7 +63,7 @@ func (c SessionHostManagementsClient) ListByHostPool(ctx context.Context, id Hos } var values struct { - Values *[]SessionHostManagement `json:"value"` + Values *[]TrustedAccessRole `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -74,16 +74,16 @@ func (c SessionHostManagementsClient) ListByHostPool(ctx context.Context, id Hos return } -// ListByHostPoolComplete retrieves all the results into a single object -func (c SessionHostManagementsClient) ListByHostPoolComplete(ctx context.Context, id HostPoolId) (ListByHostPoolCompleteResult, error) { - return c.ListByHostPoolCompleteMatchingPredicate(ctx, id, SessionHostManagementOperationPredicate{}) +// RolesListComplete retrieves all the results into a single object +func (c TrustedAccessClient) RolesListComplete(ctx context.Context, id LocationId) (RolesListCompleteResult, error) { + return c.RolesListCompleteMatchingPredicate(ctx, id, TrustedAccessRoleOperationPredicate{}) } -// ListByHostPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SessionHostManagementsClient) ListByHostPoolCompleteMatchingPredicate(ctx context.Context, id HostPoolId, predicate SessionHostManagementOperationPredicate) (result ListByHostPoolCompleteResult, err error) { - items := make([]SessionHostManagement, 0) +// RolesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c TrustedAccessClient) RolesListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate TrustedAccessRoleOperationPredicate) (result RolesListCompleteResult, err error) { + items := make([]TrustedAccessRole, 0) - resp, err := c.ListByHostPool(ctx, id) + resp, err := c.RolesList(ctx, id) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -97,7 +97,7 @@ func (c SessionHostManagementsClient) ListByHostPoolCompleteMatchingPredicate(ct } } - result = ListByHostPoolCompleteResult{ + result = RolesListCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrole.go b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrole.go new file mode 100644 index 00000000000..a24a7344c12 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrole.go @@ -0,0 +1,10 @@ +package trustedaccess + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessRole struct { + Name *string `json:"name,omitempty"` + Rules *[]TrustedAccessRoleRule `json:"rules,omitempty"` + SourceResourceType *string `json:"sourceResourceType,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfiguration.go b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebinding.go similarity index 79% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfiguration.go rename to resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebinding.go index 011f3d73969..36c110999f6 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfiguration.go +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebinding.go @@ -1,4 +1,4 @@ -package sessionhostconfiguration +package trustedaccess import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" @@ -7,10 +7,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SessionHostConfiguration struct { +type TrustedAccessRoleBinding struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties SessionHostConfigurationProperties `json:"properties"` + Properties TrustedAccessRoleBindingProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebindingproperties.go b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebindingproperties.go new file mode 100644 index 00000000000..b432519d7cc --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolebindingproperties.go @@ -0,0 +1,10 @@ +package trustedaccess + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessRoleBindingProperties struct { + ProvisioningState *TrustedAccessRoleBindingProvisioningState `json:"provisioningState,omitempty"` + Roles []string `json:"roles"` + SourceResourceId string `json:"sourceResourceId"` +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolerule.go b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolerule.go new file mode 100644 index 00000000000..808af096d0a --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/model_trustedaccessrolerule.go @@ -0,0 +1,12 @@ +package trustedaccess + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessRoleRule struct { + ApiGroups *[]string `json:"apiGroups,omitempty"` + NonResourceURLs *[]string `json:"nonResourceURLs,omitempty"` + ResourceNames *[]string `json:"resourceNames,omitempty"` + Resources *[]string `json:"resources,omitempty"` + Verbs *[]string `json:"verbs,omitempty"` +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/predicates.go b/resource-manager/containerservice/2024-09-01/trustedaccess/predicates.go new file mode 100644 index 00000000000..6bab96a78b7 --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/predicates.go @@ -0,0 +1,45 @@ +package trustedaccess + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrustedAccessRoleOperationPredicate struct { + Name *string + SourceResourceType *string +} + +func (p TrustedAccessRoleOperationPredicate) Matches(input TrustedAccessRole) bool { + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.SourceResourceType != nil && (input.SourceResourceType == nil || *p.SourceResourceType != *input.SourceResourceType) { + return false + } + + return true +} + +type TrustedAccessRoleBindingOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p TrustedAccessRoleBindingOperationPredicate) Matches(input TrustedAccessRoleBinding) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/resource-manager/containerservice/2024-09-01/trustedaccess/version.go b/resource-manager/containerservice/2024-09-01/trustedaccess/version.go new file mode 100644 index 00000000000..d45f625d8ff --- /dev/null +++ b/resource-manager/containerservice/2024-09-01/trustedaccess/version.go @@ -0,0 +1,10 @@ +package trustedaccess + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-09-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/trustedaccess/2024-09-01" +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/README.md b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/README.md similarity index 92% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/README.md rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/README.md index 82ea637f626..6dac373c5e6 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackage` Documentation -The `appattachpackage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `appattachpackage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackage" ``` @@ -48,7 +48,7 @@ if model := read.Model; model != nil { ctx := context.TODO() id := appattachpackage.NewAppAttachPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appAttachPackageName") -read, err := client.Delete(ctx, id, appattachpackage.DefaultDeleteOperationOptions()) +read, err := client.Delete(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/client.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/client.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/constants.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/id_appattachpackage.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/id_appattachpackage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/id_appattachpackage.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/id_appattachpackage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/id_appattachpackage_test.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/id_appattachpackage_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/id_appattachpackage_test.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/id_appattachpackage_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_delete.go new file mode 100644 index 00000000000..f5b6eda23ad --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_delete.go @@ -0,0 +1,47 @@ +package appattachpackage + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c AppAttachPackageClient) Delete(ctx context.Context, id AppAttachPackageId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_listbyresourcegroup.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_listbyresourcegroup.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_listbyresourcegroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_listbysubscription.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_listbysubscription.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_listbysubscription.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_listbysubscription.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackage.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackage.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackageinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackageinfoproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackageinfoproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackageinfoproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatch.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatch.go similarity index 90% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatch.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatch.go index 586a76d5627..3886adba51f 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatch.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatch.go @@ -12,6 +12,5 @@ type AppAttachPackagePatch struct { Name *string `json:"name,omitempty"` Properties *AppAttachPackagePatchProperties `json:"properties,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatchproperties.go similarity index 76% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatchproperties.go index 6a499d9c7a6..ed6f7b016cf 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackagepatchproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackagepatchproperties.go @@ -4,10 +4,8 @@ package appattachpackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AppAttachPackagePatchProperties struct { - CustomData *string `json:"customData,omitempty"` FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure `json:"failHealthCheckOnStagingFailure,omitempty"` HostPoolReferences *[]string `json:"hostPoolReferences,omitempty"` Image *AppAttachPackageInfoProperties `json:"image,omitempty"` KeyVaultURL *string `json:"keyVaultURL,omitempty"` - PackageLookbackURL *string `json:"packageLookbackUrl,omitempty"` } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackageproperties.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackageproperties.go similarity index 70% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackageproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackageproperties.go index 42953cae409..ba92d5e0951 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_appattachpackageproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_appattachpackageproperties.go @@ -4,12 +4,9 @@ package appattachpackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AppAttachPackageProperties struct { - CustomData *string `json:"customData,omitempty"` FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure `json:"failHealthCheckOnStagingFailure,omitempty"` HostPoolReferences *[]string `json:"hostPoolReferences,omitempty"` Image *AppAttachPackageInfoProperties `json:"image,omitempty"` KeyVaultURL *string `json:"keyVaultURL,omitempty"` - PackageLookbackURL *string `json:"packageLookbackUrl,omitempty"` - PackageOwnerName *string `json:"packageOwnerName,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_msixpackageapplications.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_msixpackageapplications.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_msixpackageapplications.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_msixpackageapplications.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_msixpackagedependencies.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_msixpackagedependencies.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/model_msixpackagedependencies.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/model_msixpackagedependencies.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/version.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/version.go similarity index 64% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/version.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackage/version.go index 63d66c68983..e07f1e64046 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackage/version.go @@ -3,8 +3,8 @@ package appattachpackage // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/appattachpackage/2024-04-08-preview" + return "hashicorp/go-azure-sdk/appattachpackage/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/README.md b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/README.md similarity index 89% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/README.md rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/README.md index 7c762afa22c..0156697f6b2 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo` Documentation -The `appattachpackageinfo` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `appattachpackageinfo` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/client.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/client.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/constants.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/method_import.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/method_import.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/method_import.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/method_import.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackage.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackage.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackageinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackageinfoproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackageinfoproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackageinfoproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackageproperties.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackageproperties.go similarity index 71% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackageproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackageproperties.go index 8ad62770b32..ad38518a8f2 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_appattachpackageproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_appattachpackageproperties.go @@ -4,12 +4,9 @@ package appattachpackageinfo // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AppAttachPackageProperties struct { - CustomData *string `json:"customData,omitempty"` FailHealthCheckOnStagingFailure *FailHealthCheckOnStagingFailure `json:"failHealthCheckOnStagingFailure,omitempty"` HostPoolReferences *[]string `json:"hostPoolReferences,omitempty"` Image *AppAttachPackageInfoProperties `json:"image,omitempty"` KeyVaultURL *string `json:"keyVaultURL,omitempty"` - PackageLookbackURL *string `json:"packageLookbackUrl,omitempty"` - PackageOwnerName *string `json:"packageOwnerName,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_importpackageinforequest.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_importpackageinforequest.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_importpackageinforequest.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_importpackageinforequest.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_msixpackageapplications.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_msixpackageapplications.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_msixpackageapplications.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_msixpackageapplications.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_msixpackagedependencies.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_msixpackagedependencies.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/model_msixpackagedependencies.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/model_msixpackagedependencies.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/version.go b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/version.go similarity index 64% rename from resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/version.go rename to resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/version.go index 43559b52f10..2f65de6b285 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo/version.go @@ -3,8 +3,8 @@ package appattachpackageinfo // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/appattachpackageinfo/2024-04-08-preview" + return "hashicorp/go-azure-sdk/appattachpackageinfo/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/README.md b/resource-manager/desktopvirtualization/2024-04-03/application/README.md similarity index 93% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/README.md rename to resource-manager/desktopvirtualization/2024-04-03/application/README.md index f405da0aaac..37f6e89df85 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/application/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/application/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/application` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/application` Documentation -The `application` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `application` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/application" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/application" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/client.go b/resource-manager/desktopvirtualization/2024-04-03/application/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/client.go rename to resource-manager/desktopvirtualization/2024-04-03/application/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/constants.go b/resource-manager/desktopvirtualization/2024-04-03/application/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/application/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/id_application.go b/resource-manager/desktopvirtualization/2024-04-03/application/id_application.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/id_application.go rename to resource-manager/desktopvirtualization/2024-04-03/application/id_application.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/id_application_test.go b/resource-manager/desktopvirtualization/2024-04-03/application/id_application_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/id_application_test.go rename to resource-manager/desktopvirtualization/2024-04-03/application/id_application_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/id_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-03/application/id_applicationgroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/id_applicationgroup.go rename to resource-manager/desktopvirtualization/2024-04-03/application/id_applicationgroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/id_applicationgroup_test.go b/resource-manager/desktopvirtualization/2024-04-03/application/id_applicationgroup_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/id_applicationgroup_test.go rename to resource-manager/desktopvirtualization/2024-04-03/application/id_applicationgroup_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/application/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/application/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/application/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/application/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/application/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/application/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/application/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/application/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/application/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/application/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/model_application.go b/resource-manager/desktopvirtualization/2024-04-03/application/model_application.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/model_application.go rename to resource-manager/desktopvirtualization/2024-04-03/application/model_application.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationpatch.go b/resource-manager/desktopvirtualization/2024-04-03/application/model_applicationpatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationpatch.go rename to resource-manager/desktopvirtualization/2024-04-03/application/model_applicationpatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/application/model_applicationpatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationpatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/application/model_applicationpatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationproperties.go b/resource-manager/desktopvirtualization/2024-04-03/application/model_applicationproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/model_applicationproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/application/model_applicationproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/application/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/application/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/application/version.go b/resource-manager/desktopvirtualization/2024-04-03/application/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/application/version.go rename to resource-manager/desktopvirtualization/2024-04-03/application/version.go index a117e73703a..bcbe57a0b09 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/application/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/application/version.go @@ -3,8 +3,8 @@ package application // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/application/2024-04-08-preview" + return "hashicorp/go-azure-sdk/application/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/README.md b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/README.md similarity index 94% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/README.md rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/README.md index c5b9581ceb1..d37196629cb 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/applicationgroup` Documentation -The `applicationgroup` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `applicationgroup` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/applicationgroup" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/client.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/client.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/constants.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/id_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/id_applicationgroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/id_applicationgroup.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/id_applicationgroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/id_applicationgroup_test.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/id_applicationgroup_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/id_applicationgroup_test.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/id_applicationgroup_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_listbyresourcegroup.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_listbyresourcegroup.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_listbyresourcegroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_listbysubscription.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_listbysubscription.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_listbysubscription.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_listbysubscription.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroup.go new file mode 100644 index 00000000000..8ef5660f699 --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroup.go @@ -0,0 +1,25 @@ +package applicationgroup + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationGroup struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAssigned `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + ManagedBy *string `json:"managedBy,omitempty"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties ApplicationGroupProperties `json:"properties"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgrouppatch.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgrouppatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgrouppatch.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgrouppatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgrouppatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgrouppatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgrouppatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgrouppatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroupproperties.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroupproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroupproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_applicationgroupproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_plan.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_plan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_plan.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_plan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_sku.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_sku.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_sku.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/model_sku.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/version.go b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/version.go similarity index 64% rename from resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/version.go rename to resource-manager/desktopvirtualization/2024-04-03/applicationgroup/version.go index af111e50b95..94311958c5f 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/applicationgroup/version.go @@ -3,8 +3,8 @@ package applicationgroup // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/applicationgroup/2024-04-08-preview" + return "hashicorp/go-azure-sdk/applicationgroup/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/client.go b/resource-manager/desktopvirtualization/2024-04-03/client.go similarity index 50% rename from resource-manager/desktopvirtualization/2024-04-08-preview/client.go rename to resource-manager/desktopvirtualization/2024-04-03/client.go index c1b0507e61c..5ddd79fe884 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/client.go +++ b/resource-manager/desktopvirtualization/2024-04-03/client.go @@ -1,4 +1,4 @@ -package v2024_04_08_preview +package v2024_04_03 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -6,60 +6,46 @@ package v2024_04_08_preview import ( "fmt" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackage" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/appattachpackageinfo" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/application" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/desktop" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/usersession" - "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/workspace" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackage" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/appattachpackageinfo" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/application" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/applicationgroup" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/desktop" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/hostpool" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msiximage" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msixpackage" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/privatelink" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplan" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/sessionhost" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/startmenuitem" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/usersession" + "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/workspace" "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" ) type Client struct { - ActiveSessionHostConfiguration *activesessionhostconfiguration.ActiveSessionHostConfigurationClient - AppAttachPackage *appattachpackage.AppAttachPackageClient - AppAttachPackageInfo *appattachpackageinfo.AppAttachPackageInfoClient - Application *application.ApplicationClient - ApplicationGroup *applicationgroup.ApplicationGroupClient - Desktop *desktop.DesktopClient - HostPool *hostpool.HostPoolClient - MSIXPackage *msixpackage.MSIXPackageClient - MsixImage *msiximage.MsixImageClient - PrivateLink *privatelink.PrivateLinkClient - ScalingPlan *scalingplan.ScalingPlanClient - ScalingPlanPersonalSchedule *scalingplanpersonalschedule.ScalingPlanPersonalScheduleClient - ScalingPlanPooledSchedule *scalingplanpooledschedule.ScalingPlanPooledScheduleClient - SessionHost *sessionhost.SessionHostClient - SessionHostConfiguration *sessionhostconfiguration.SessionHostConfigurationClient - SessionHostManagement *sessionhostmanagement.SessionHostManagementClient - SessionHostManagements *sessionhostmanagements.SessionHostManagementsClient - StartMenuItem *startmenuitem.StartMenuItemClient - UserSession *usersession.UserSessionClient - Workspace *workspace.WorkspaceClient + AppAttachPackage *appattachpackage.AppAttachPackageClient + AppAttachPackageInfo *appattachpackageinfo.AppAttachPackageInfoClient + Application *application.ApplicationClient + ApplicationGroup *applicationgroup.ApplicationGroupClient + Desktop *desktop.DesktopClient + HostPool *hostpool.HostPoolClient + MSIXPackage *msixpackage.MSIXPackageClient + MsixImage *msiximage.MsixImageClient + PrivateLink *privatelink.PrivateLinkClient + ScalingPlan *scalingplan.ScalingPlanClient + ScalingPlanPersonalSchedule *scalingplanpersonalschedule.ScalingPlanPersonalScheduleClient + ScalingPlanPooledSchedule *scalingplanpooledschedule.ScalingPlanPooledScheduleClient + SessionHost *sessionhost.SessionHostClient + StartMenuItem *startmenuitem.StartMenuItemClient + UserSession *usersession.UserSessionClient + Workspace *workspace.WorkspaceClient } func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - activeSessionHostConfigurationClient, err := activesessionhostconfiguration.NewActiveSessionHostConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ActiveSessionHostConfiguration client: %+v", err) - } - configureFunc(activeSessionHostConfigurationClient.Client) - appAttachPackageClient, err := appattachpackage.NewAppAttachPackageClientWithBaseURI(sdkApi) if err != nil { return nil, fmt.Errorf("building AppAttachPackage client: %+v", err) @@ -138,24 +124,6 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag } configureFunc(sessionHostClient.Client) - sessionHostConfigurationClient, err := sessionhostconfiguration.NewSessionHostConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SessionHostConfiguration client: %+v", err) - } - configureFunc(sessionHostConfigurationClient.Client) - - sessionHostManagementClient, err := sessionhostmanagement.NewSessionHostManagementClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SessionHostManagement client: %+v", err) - } - configureFunc(sessionHostManagementClient.Client) - - sessionHostManagementsClient, err := sessionhostmanagements.NewSessionHostManagementsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SessionHostManagements client: %+v", err) - } - configureFunc(sessionHostManagementsClient.Client) - startMenuItemClient, err := startmenuitem.NewStartMenuItemClientWithBaseURI(sdkApi) if err != nil { return nil, fmt.Errorf("building StartMenuItem client: %+v", err) @@ -175,25 +143,21 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag configureFunc(workspaceClient.Client) return &Client{ - ActiveSessionHostConfiguration: activeSessionHostConfigurationClient, - AppAttachPackage: appAttachPackageClient, - AppAttachPackageInfo: appAttachPackageInfoClient, - Application: applicationClient, - ApplicationGroup: applicationGroupClient, - Desktop: desktopClient, - HostPool: hostPoolClient, - MSIXPackage: mSIXPackageClient, - MsixImage: msixImageClient, - PrivateLink: privateLinkClient, - ScalingPlan: scalingPlanClient, - ScalingPlanPersonalSchedule: scalingPlanPersonalScheduleClient, - ScalingPlanPooledSchedule: scalingPlanPooledScheduleClient, - SessionHost: sessionHostClient, - SessionHostConfiguration: sessionHostConfigurationClient, - SessionHostManagement: sessionHostManagementClient, - SessionHostManagements: sessionHostManagementsClient, - StartMenuItem: startMenuItemClient, - UserSession: userSessionClient, - Workspace: workspaceClient, + AppAttachPackage: appAttachPackageClient, + AppAttachPackageInfo: appAttachPackageInfoClient, + Application: applicationClient, + ApplicationGroup: applicationGroupClient, + Desktop: desktopClient, + HostPool: hostPoolClient, + MSIXPackage: mSIXPackageClient, + MsixImage: msixImageClient, + PrivateLink: privateLinkClient, + ScalingPlan: scalingPlanClient, + ScalingPlanPersonalSchedule: scalingPlanPersonalScheduleClient, + ScalingPlanPooledSchedule: scalingPlanPooledScheduleClient, + SessionHost: sessionHostClient, + StartMenuItem: startMenuItemClient, + UserSession: userSessionClient, + Workspace: workspaceClient, }, nil } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/README.md b/resource-manager/desktopvirtualization/2024-04-03/desktop/README.md similarity index 91% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/README.md rename to resource-manager/desktopvirtualization/2024-04-03/desktop/README.md index fa7a0903338..6a5e71169f5 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/desktop/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/desktop` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/desktop` Documentation -The `desktop` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `desktop` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/desktop" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/desktop" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/client.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/client.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/id_applicationgroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_applicationgroup.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/id_applicationgroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_applicationgroup_test.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/id_applicationgroup_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_applicationgroup_test.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/id_applicationgroup_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_desktop.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/id_desktop.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_desktop.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/id_desktop.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_desktop_test.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/id_desktop_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/id_desktop_test.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/id_desktop_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktop.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktop.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktop.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktop.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktoppatch.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktoppatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktoppatch.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktoppatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktoppatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktoppatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktoppatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktoppatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktopproperties.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktopproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/model_desktopproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/model_desktopproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/version.go b/resource-manager/desktopvirtualization/2024-04-03/desktop/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/desktop/version.go rename to resource-manager/desktopvirtualization/2024-04-03/desktop/version.go index d0326ae69c9..69b7f5f1332 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/desktop/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/desktop/version.go @@ -3,8 +3,8 @@ package desktop // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/desktop/2024-04-08-preview" + return "hashicorp/go-azure-sdk/desktop/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/README.md b/resource-manager/desktopvirtualization/2024-04-03/hostpool/README.md similarity index 95% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/README.md rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/README.md index 65a427654b7..34d1471abac 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/hostpool` Documentation -The `hostpool` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `hostpool` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/hostpool" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/client.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/client.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/constants.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/constants.go similarity index 74% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/constants.go index aa43ad36647..5e48aa61128 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/constants.go +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/constants.go @@ -65,50 +65,6 @@ func parseDayOfWeek(input string) (*DayOfWeek, error) { return &out, nil } -type DirectUDP string - -const ( - DirectUDPDefault DirectUDP = "Default" - DirectUDPDisabled DirectUDP = "Disabled" - DirectUDPEnabled DirectUDP = "Enabled" -) - -func PossibleValuesForDirectUDP() []string { - return []string{ - string(DirectUDPDefault), - string(DirectUDPDisabled), - string(DirectUDPEnabled), - } -} - -func (s *DirectUDP) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDirectUDP(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDirectUDP(input string) (*DirectUDP, error) { - vals := map[string]DirectUDP{ - "default": DirectUDPDefault, - "disabled": DirectUDPDisabled, - "enabled": DirectUDPEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DirectUDP(input) - return &out, nil -} - type HostPoolType string const ( @@ -203,17 +159,15 @@ func parseHostpoolPublicNetworkAccess(input string) (*HostpoolPublicNetworkAcces type LoadBalancerType string const ( - LoadBalancerTypeBreadthFirst LoadBalancerType = "BreadthFirst" - LoadBalancerTypeDepthFirst LoadBalancerType = "DepthFirst" - LoadBalancerTypeMultiplePersistent LoadBalancerType = "MultiplePersistent" - LoadBalancerTypePersistent LoadBalancerType = "Persistent" + LoadBalancerTypeBreadthFirst LoadBalancerType = "BreadthFirst" + LoadBalancerTypeDepthFirst LoadBalancerType = "DepthFirst" + LoadBalancerTypePersistent LoadBalancerType = "Persistent" ) func PossibleValuesForLoadBalancerType() []string { return []string{ string(LoadBalancerTypeBreadthFirst), string(LoadBalancerTypeDepthFirst), - string(LoadBalancerTypeMultiplePersistent), string(LoadBalancerTypePersistent), } } @@ -233,10 +187,9 @@ func (s *LoadBalancerType) UnmarshalJSON(bytes []byte) error { func parseLoadBalancerType(input string) (*LoadBalancerType, error) { vals := map[string]LoadBalancerType{ - "breadthfirst": LoadBalancerTypeBreadthFirst, - "depthfirst": LoadBalancerTypeDepthFirst, - "multiplepersistent": LoadBalancerTypeMultiplePersistent, - "persistent": LoadBalancerTypePersistent, + "breadthfirst": LoadBalancerTypeBreadthFirst, + "depthfirst": LoadBalancerTypeDepthFirst, + "persistent": LoadBalancerTypePersistent, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -247,91 +200,6 @@ func parseLoadBalancerType(input string) (*LoadBalancerType, error) { return &out, nil } -type ManagedPrivateUDP string - -const ( - ManagedPrivateUDPDefault ManagedPrivateUDP = "Default" - ManagedPrivateUDPDisabled ManagedPrivateUDP = "Disabled" - ManagedPrivateUDPEnabled ManagedPrivateUDP = "Enabled" -) - -func PossibleValuesForManagedPrivateUDP() []string { - return []string{ - string(ManagedPrivateUDPDefault), - string(ManagedPrivateUDPDisabled), - string(ManagedPrivateUDPEnabled), - } -} - -func (s *ManagedPrivateUDP) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseManagedPrivateUDP(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseManagedPrivateUDP(input string) (*ManagedPrivateUDP, error) { - vals := map[string]ManagedPrivateUDP{ - "default": ManagedPrivateUDPDefault, - "disabled": ManagedPrivateUDPDisabled, - "enabled": ManagedPrivateUDPEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedPrivateUDP(input) - return &out, nil -} - -type ManagementType string - -const ( - ManagementTypeAutomated ManagementType = "Automated" - ManagementTypeStandard ManagementType = "Standard" -) - -func PossibleValuesForManagementType() []string { - return []string{ - string(ManagementTypeAutomated), - string(ManagementTypeStandard), - } -} - -func (s *ManagementType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseManagementType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseManagementType(input string) (*ManagementType, error) { - vals := map[string]ManagementType{ - "automated": ManagementTypeAutomated, - "standard": ManagementTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagementType(input) - return &out, nil -} - type PersonalDesktopAssignmentType string const ( @@ -508,50 +376,6 @@ func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpoint return &out, nil } -type PublicUDP string - -const ( - PublicUDPDefault PublicUDP = "Default" - PublicUDPDisabled PublicUDP = "Disabled" - PublicUDPEnabled PublicUDP = "Enabled" -) - -func PossibleValuesForPublicUDP() []string { - return []string{ - string(PublicUDPDefault), - string(PublicUDPDisabled), - string(PublicUDPEnabled), - } -} - -func (s *PublicUDP) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicUDP(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicUDP(input string) (*PublicUDP, error) { - vals := map[string]PublicUDP{ - "default": PublicUDPDefault, - "disabled": PublicUDPDisabled, - "enabled": PublicUDPEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicUDP(input) - return &out, nil -} - type RegistrationTokenOperation string const ( @@ -596,50 +420,6 @@ func parseRegistrationTokenOperation(input string) (*RegistrationTokenOperation, return &out, nil } -type RelayUDP string - -const ( - RelayUDPDefault RelayUDP = "Default" - RelayUDPDisabled RelayUDP = "Disabled" - RelayUDPEnabled RelayUDP = "Enabled" -) - -func PossibleValuesForRelayUDP() []string { - return []string{ - string(RelayUDPDefault), - string(RelayUDPDisabled), - string(RelayUDPEnabled), - } -} - -func (s *RelayUDP) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRelayUDP(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRelayUDP(input string) (*RelayUDP, error) { - vals := map[string]RelayUDP{ - "default": RelayUDPDefault, - "disabled": RelayUDPDisabled, - "enabled": RelayUDPEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RelayUDP(input) - return &out, nil -} - type SSOSecretType string const ( diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_listbyresourcegroup.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_listbyresourcegroup.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_listbyresourcegroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_listregistrationtokens.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_listregistrationtokens.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_listregistrationtokens.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_listregistrationtokens.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_retrieveregistrationtoken.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_retrieveregistrationtoken.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_retrieveregistrationtoken.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_retrieveregistrationtoken.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_agentupdatepatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_agentupdatepatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_agentupdatepatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_agentupdatepatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_agentupdateproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_agentupdateproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_agentupdateproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_agentupdateproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpool.go new file mode 100644 index 00000000000..b9d8480f2c0 --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpool.go @@ -0,0 +1,25 @@ +package hostpool + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostPool struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAssigned `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + ManagedBy *string `json:"managedBy,omitempty"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties HostPoolProperties `json:"properties"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolpatch.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolpatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolpatch.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolpatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolpatchproperties.go similarity index 84% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolpatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolpatchproperties.go index faa6508312f..91050346d63 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolpatchproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolpatchproperties.go @@ -7,17 +7,13 @@ type HostPoolPatchProperties struct { AgentUpdate *AgentUpdatePatchProperties `json:"agentUpdate,omitempty"` CustomRdpProperty *string `json:"customRdpProperty,omitempty"` Description *string `json:"description,omitempty"` - DirectUDP *DirectUDP `json:"directUDP,omitempty"` FriendlyName *string `json:"friendlyName,omitempty"` LoadBalancerType *LoadBalancerType `json:"loadBalancerType,omitempty"` - ManagedPrivateUDP *ManagedPrivateUDP `json:"managedPrivateUDP,omitempty"` MaxSessionLimit *int64 `json:"maxSessionLimit,omitempty"` PersonalDesktopAssignmentType *PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - PublicUDP *PublicUDP `json:"publicUDP,omitempty"` RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` - RelayUDP *RelayUDP `json:"relayUDP,omitempty"` Ring *int64 `json:"ring,omitempty"` SsoClientId *string `json:"ssoClientId,omitempty"` SsoClientSecretKeyVaultPath *string `json:"ssoClientSecretKeyVaultPath,omitempty"` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolproperties.go similarity index 84% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolproperties.go index 480dd978524..5cf25753195 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpoolproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_hostpoolproperties.go @@ -10,21 +10,16 @@ type HostPoolProperties struct { CloudPcResource *bool `json:"cloudPcResource,omitempty"` CustomRdpProperty *string `json:"customRdpProperty,omitempty"` Description *string `json:"description,omitempty"` - DirectUDP *DirectUDP `json:"directUDP,omitempty"` FriendlyName *string `json:"friendlyName,omitempty"` HostPoolType HostPoolType `json:"hostPoolType"` LoadBalancerType LoadBalancerType `json:"loadBalancerType"` - ManagedPrivateUDP *ManagedPrivateUDP `json:"managedPrivateUDP,omitempty"` - ManagementType *ManagementType `json:"managementType,omitempty"` MaxSessionLimit *int64 `json:"maxSessionLimit,omitempty"` ObjectId *string `json:"objectId,omitempty"` PersonalDesktopAssignmentType *PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` PreferredAppGroupType PreferredAppGroupType `json:"preferredAppGroupType"` PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - PublicUDP *PublicUDP `json:"publicUDP,omitempty"` RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` - RelayUDP *RelayUDP `json:"relayUDP,omitempty"` Ring *int64 `json:"ring,omitempty"` SsoClientId *string `json:"ssoClientId,omitempty"` SsoClientSecretKeyVaultPath *string `json:"ssoClientSecretKeyVaultPath,omitempty"` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_maintenancewindowpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_maintenancewindowpatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_maintenancewindowpatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_maintenancewindowpatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_maintenancewindowproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_maintenancewindowproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_maintenancewindowproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_maintenancewindowproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_plan.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_plan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_plan.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_plan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpoint.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpoint.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpoint.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpoint.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpointconnection.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpointconnection.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpointconnection.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpointconnection.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpointconnectionproperties.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpointconnectionproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privateendpointconnectionproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privateendpointconnectionproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privatelinkserviceconnectionstate.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_privatelinkserviceconnectionstate.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationinfo.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationinfo.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationinfo.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationinfo.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationinfopatch.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationinfopatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationinfopatch.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationinfopatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationtokenminimal.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationtokenminimal.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_registrationtokenminimal.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_registrationtokenminimal.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_sku.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/model_sku.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_sku.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/model_sku.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/version.go b/resource-manager/desktopvirtualization/2024-04-03/hostpool/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/version.go rename to resource-manager/desktopvirtualization/2024-04-03/hostpool/version.go index 9df519bcc7b..eee706db0d2 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/hostpool/version.go @@ -3,8 +3,8 @@ package hostpool // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/hostpool/2024-04-08-preview" + return "hashicorp/go-azure-sdk/hostpool/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/README.md b/resource-manager/desktopvirtualization/2024-04-03/msiximage/README.md similarity index 85% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/README.md rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/README.md index 02d493cb7b0..67046c700c7 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/msiximage/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msiximage` Documentation -The `msiximage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `msiximage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msiximage" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/client.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/client.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/method_expand.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/method_expand.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/method_expand.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/method_expand.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_expandmsiximage.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/model_expandmsiximage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_expandmsiximage.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/model_expandmsiximage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_expandmsiximageproperties.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/model_expandmsiximageproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_expandmsiximageproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/model_expandmsiximageproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msiximageuri.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msiximageuri.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msiximageuri.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msiximageuri.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msixpackageapplications.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msixpackageapplications.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msixpackageapplications.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msixpackageapplications.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msixpackagedependencies.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msixpackagedependencies.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/model_msixpackagedependencies.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/model_msixpackagedependencies.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/version.go b/resource-manager/desktopvirtualization/2024-04-03/msiximage/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/version.go rename to resource-manager/desktopvirtualization/2024-04-03/msiximage/version.go index 897f39f4f94..3c2f8035665 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/msiximage/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/msiximage/version.go @@ -3,8 +3,8 @@ package msiximage // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/msiximage/2024-04-08-preview" + return "hashicorp/go-azure-sdk/msiximage/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/README.md b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/README.md similarity index 93% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/README.md rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/README.md index 4825fe9e3a3..462c4c0ee6b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msixpackage` Documentation -The `msixpackage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `msixpackage` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/msixpackage" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/client.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/client.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_msixpackage.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_msixpackage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_msixpackage.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_msixpackage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_msixpackage_test.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_msixpackage_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/id_msixpackage_test.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/id_msixpackage_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackage.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackage.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackageapplications.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackageapplications.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackageapplications.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackageapplications.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagedependencies.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagedependencies.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagedependencies.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagedependencies.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagepatch.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagepatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagepatch.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagepatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagepatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagepatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackagepatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackagepatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackageproperties.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackageproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/model_msixpackageproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/model_msixpackageproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/version.go b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/version.go rename to resource-manager/desktopvirtualization/2024-04-03/msixpackage/version.go index 01e17eabc29..b2cf6fc7ce4 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/msixpackage/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/msixpackage/version.go @@ -3,8 +3,8 @@ package msixpackage // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/msixpackage/2024-04-08-preview" + return "hashicorp/go-azure-sdk/msixpackage/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/README.md b/resource-manager/desktopvirtualization/2024-04-03/privatelink/README.md similarity index 97% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/README.md rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/README.md index 92338831157..1d2c3cdf69c 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/privatelink` Documentation -The `privatelink` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `privatelink` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/privatelink" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/client.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/client.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/constants.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_privateendpointconnection.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_privateendpointconnection.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_privateendpointconnection.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_privateendpointconnection.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_privateendpointconnection_test.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_privateendpointconnection_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_privateendpointconnection_test.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_privateendpointconnection_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspace.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspace.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspace_test.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspace_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspace_test.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspace_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspaceprivateendpointconnection.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspaceprivateendpointconnection.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspaceprivateendpointconnection.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspaceprivateendpointconnection.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspaceprivateendpointconnection_test.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspaceprivateendpointconnection_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/id_workspaceprivateendpointconnection_test.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/id_workspaceprivateendpointconnection_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsdeletebyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsdeletebyhostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsdeletebyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsdeletebyhostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsdeletebyworkspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsdeletebyworkspace.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsdeletebyworkspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsdeletebyworkspace.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyhostpool.go similarity index 92% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyhostpool.go index 678782e613f..edc7197e9b6 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyhostpool.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyhostpool.go @@ -14,7 +14,7 @@ import ( type PrivateEndpointConnectionsGetByHostPoolOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *PrivateEndpointConnection + Model *PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsGetByHostPool ... @@ -43,7 +43,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsGetByHostPool(ctx context.C return } - var model PrivateEndpointConnection + var model PrivateEndpointConnectionWithSystemData result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyworkspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyworkspace.go similarity index 92% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyworkspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyworkspace.go index 07e82e2c773..431c1182404 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsgetbyworkspace.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsgetbyworkspace.go @@ -14,7 +14,7 @@ import ( type PrivateEndpointConnectionsGetByWorkspaceOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *PrivateEndpointConnection + Model *PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsGetByWorkspace ... @@ -43,7 +43,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsGetByWorkspace(ctx context. return } - var model PrivateEndpointConnection + var model PrivateEndpointConnectionWithSystemData result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyhostpool.go similarity index 89% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyhostpool.go index 50a9d10ac8b..8ede1e24012 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyhostpool.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyhostpool.go @@ -15,12 +15,12 @@ import ( type PrivateEndpointConnectionsListByHostPoolOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PrivateEndpointConnection + Model *[]PrivateEndpointConnectionWithSystemData } type PrivateEndpointConnectionsListByHostPoolCompleteResult struct { LatestHttpResponse *http.Response - Items []PrivateEndpointConnection + Items []PrivateEndpointConnectionWithSystemData } type PrivateEndpointConnectionsListByHostPoolOperationOptions struct { @@ -100,7 +100,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsListByHostPool(ctx context. } var values struct { - Values *[]PrivateEndpointConnection `json:"value"` + Values *[]PrivateEndpointConnectionWithSystemData `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -113,12 +113,12 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsListByHostPool(ctx context. // PrivateEndpointConnectionsListByHostPoolComplete retrieves all the results into a single object func (c PrivateLinkClient) PrivateEndpointConnectionsListByHostPoolComplete(ctx context.Context, id HostPoolId, options PrivateEndpointConnectionsListByHostPoolOperationOptions) (PrivateEndpointConnectionsListByHostPoolCompleteResult, error) { - return c.PrivateEndpointConnectionsListByHostPoolCompleteMatchingPredicate(ctx, id, options, PrivateEndpointConnectionOperationPredicate{}) + return c.PrivateEndpointConnectionsListByHostPoolCompleteMatchingPredicate(ctx, id, options, PrivateEndpointConnectionWithSystemDataOperationPredicate{}) } // PrivateEndpointConnectionsListByHostPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkClient) PrivateEndpointConnectionsListByHostPoolCompleteMatchingPredicate(ctx context.Context, id HostPoolId, options PrivateEndpointConnectionsListByHostPoolOperationOptions, predicate PrivateEndpointConnectionOperationPredicate) (result PrivateEndpointConnectionsListByHostPoolCompleteResult, err error) { - items := make([]PrivateEndpointConnection, 0) +func (c PrivateLinkClient) PrivateEndpointConnectionsListByHostPoolCompleteMatchingPredicate(ctx context.Context, id HostPoolId, options PrivateEndpointConnectionsListByHostPoolOperationOptions, predicate PrivateEndpointConnectionWithSystemDataOperationPredicate) (result PrivateEndpointConnectionsListByHostPoolCompleteResult, err error) { + items := make([]PrivateEndpointConnectionWithSystemData, 0) resp, err := c.PrivateEndpointConnectionsListByHostPool(ctx, id, options) if err != nil { diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyworkspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyworkspace.go similarity index 85% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyworkspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyworkspace.go index 96db3f78bc9..94e5e91195a 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionslistbyworkspace.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionslistbyworkspace.go @@ -15,12 +15,12 @@ import ( type PrivateEndpointConnectionsListByWorkspaceOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PrivateEndpointConnection + Model *[]PrivateEndpointConnectionWithSystemData } type PrivateEndpointConnectionsListByWorkspaceCompleteResult struct { LatestHttpResponse *http.Response - Items []PrivateEndpointConnection + Items []PrivateEndpointConnectionWithSystemData } type PrivateEndpointConnectionsListByWorkspaceCustomPager struct { @@ -63,7 +63,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsListByWorkspace(ctx context } var values struct { - Values *[]PrivateEndpointConnection `json:"value"` + Values *[]PrivateEndpointConnectionWithSystemData `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -76,12 +76,12 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsListByWorkspace(ctx context // PrivateEndpointConnectionsListByWorkspaceComplete retrieves all the results into a single object func (c PrivateLinkClient) PrivateEndpointConnectionsListByWorkspaceComplete(ctx context.Context, id WorkspaceId) (PrivateEndpointConnectionsListByWorkspaceCompleteResult, error) { - return c.PrivateEndpointConnectionsListByWorkspaceCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionOperationPredicate{}) + return c.PrivateEndpointConnectionsListByWorkspaceCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionWithSystemDataOperationPredicate{}) } // PrivateEndpointConnectionsListByWorkspaceCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkClient) PrivateEndpointConnectionsListByWorkspaceCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate PrivateEndpointConnectionOperationPredicate) (result PrivateEndpointConnectionsListByWorkspaceCompleteResult, err error) { - items := make([]PrivateEndpointConnection, 0) +func (c PrivateLinkClient) PrivateEndpointConnectionsListByWorkspaceCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate PrivateEndpointConnectionWithSystemDataOperationPredicate) (result PrivateEndpointConnectionsListByWorkspaceCompleteResult, err error) { + items := make([]PrivateEndpointConnectionWithSystemData, 0) resp, err := c.PrivateEndpointConnectionsListByWorkspace(ctx, id) if err != nil { diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyhostpool.go similarity index 92% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyhostpool.go index c525f8db572..8a925a10a4b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyhostpool.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyhostpool.go @@ -14,7 +14,7 @@ import ( type PrivateEndpointConnectionsUpdateByHostPoolOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *PrivateEndpointConnection + Model *PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsUpdateByHostPool ... @@ -47,7 +47,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsUpdateByHostPool(ctx contex return } - var model PrivateEndpointConnection + var model PrivateEndpointConnectionWithSystemData result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyworkspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyworkspace.go similarity index 92% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyworkspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyworkspace.go index 1c30a554f7d..3a4bab53489 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_privateendpointconnectionsupdatebyworkspace.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_privateendpointconnectionsupdatebyworkspace.go @@ -14,7 +14,7 @@ import ( type PrivateEndpointConnectionsUpdateByWorkspaceOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *PrivateEndpointConnection + Model *PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsUpdateByWorkspace ... @@ -47,7 +47,7 @@ func (c PrivateLinkClient) PrivateEndpointConnectionsUpdateByWorkspace(ctx conte return } - var model PrivateEndpointConnection + var model PrivateEndpointConnectionWithSystemData result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_resourceslistbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_resourceslistbyhostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_resourceslistbyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_resourceslistbyhostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_resourceslistbyworkspace.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/method_resourceslistbyworkspace.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/method_resourceslistbyworkspace.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/method_resourceslistbyworkspace.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpoint.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpoint.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpoint.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpoint.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpointconnection.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnection.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpointconnection.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnection.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpointconnectionproperties.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privateendpointconnectionproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionwithsystemdata.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionwithsystemdata.go new file mode 100644 index 00000000000..3d794ce90fc --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privateendpointconnectionwithsystemdata.go @@ -0,0 +1,16 @@ +package privatelink + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionWithSystemData struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkresource.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkresource.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkresource.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkresource.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkresourceproperties.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkresourceproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkresourceproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkresourceproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkserviceconnectionstate.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/model_privatelinkserviceconnectionstate.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/predicates.go similarity index 82% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/predicates.go index da93da5a52f..c26c480e357 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/predicates.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/predicates.go @@ -3,13 +3,13 @@ package privatelink // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PrivateEndpointConnectionOperationPredicate struct { +type PrivateEndpointConnectionWithSystemDataOperationPredicate struct { Id *string Name *string Type *string } -func (p PrivateEndpointConnectionOperationPredicate) Matches(input PrivateEndpointConnection) bool { +func (p PrivateEndpointConnectionWithSystemDataOperationPredicate) Matches(input PrivateEndpointConnectionWithSystemData) bool { if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { return false diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/version.go b/resource-manager/desktopvirtualization/2024-04-03/privatelink/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/version.go rename to resource-manager/desktopvirtualization/2024-04-03/privatelink/version.go index 2c815fe16d6..b53cb620d00 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/privatelink/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/privatelink/version.go @@ -3,8 +3,8 @@ package privatelink // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/privatelink/2024-04-08-preview" + return "hashicorp/go-azure-sdk/privatelink/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/README.md b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/README.md similarity index 95% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/README.md rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/README.md index 653d5d7a8a1..20a6913c397 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplan` Documentation -The `scalingplan` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `scalingplan` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplan" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/client.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/client.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/constants.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/constants.go similarity index 96% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/constants.go index c7acaf33f9c..5f13b68af9f 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/constants.go +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/constants.go @@ -68,13 +68,11 @@ func parseDaysOfWeek(input string) (*DaysOfWeek, error) { type ScalingHostPoolType string const ( - ScalingHostPoolTypePersonal ScalingHostPoolType = "Personal" - ScalingHostPoolTypePooled ScalingHostPoolType = "Pooled" + ScalingHostPoolTypePooled ScalingHostPoolType = "Pooled" ) func PossibleValuesForScalingHostPoolType() []string { return []string{ - string(ScalingHostPoolTypePersonal), string(ScalingHostPoolTypePooled), } } @@ -94,8 +92,7 @@ func (s *ScalingHostPoolType) UnmarshalJSON(bytes []byte) error { func parseScalingHostPoolType(input string) (*ScalingHostPoolType, error) { vals := map[string]ScalingHostPoolType{ - "personal": ScalingHostPoolTypePersonal, - "pooled": ScalingHostPoolTypePooled, + "pooled": ScalingHostPoolTypePooled, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_scalingplan.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_scalingplan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_scalingplan.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_scalingplan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_scalingplan_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_scalingplan_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/id_scalingplan_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/id_scalingplan_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_create.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_create.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_create.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_create.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbyhostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbyhostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbyresourcegroup.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbyresourcegroup.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbyresourcegroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbysubscription.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbysubscription.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_listbysubscription.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_listbysubscription.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_plan.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_plan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_plan.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_plan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalinghostpoolreference.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalinghostpoolreference.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalinghostpoolreference.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalinghostpoolreference.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplan.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplan.go new file mode 100644 index 00000000000..aafe21ac7fb --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplan.go @@ -0,0 +1,25 @@ +package scalingplan + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScalingPlan struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAssigned `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + ManagedBy *string `json:"managedBy,omitempty"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties ScalingPlanProperties `json:"properties"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanpatch.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanpatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanpatch.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanpatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanpatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanpatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanpatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanproperties.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplanproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingplanproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingschedule.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingschedule.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingschedule.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_scalingschedule.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_sku.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_sku.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_sku.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_sku.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_time.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_time.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_time.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/model_time.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/version.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/version.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplan/version.go index 455628aade4..15a666d9afd 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplan/version.go @@ -3,8 +3,8 @@ package scalingplan // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/scalingplan/2024-04-08-preview" + return "hashicorp/go-azure-sdk/scalingplan/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/README.md b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/README.md similarity index 95% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/README.md rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/README.md index db7e658bd3d..be14eb5306d 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule` Documentation -The `scalingplanpersonalschedule` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `scalingplanpersonalschedule` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/client.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/client.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/constants.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_personalschedule.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_personalschedule.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_personalschedule.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_personalschedule.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_personalschedule_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_personalschedule_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_personalschedule_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_personalschedule_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_scalingplan.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_scalingplan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_scalingplan.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_scalingplan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_scalingplan_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_scalingplan_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/id_scalingplan_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/id_scalingplan_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_create.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_create.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_create.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_create.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalschedule.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalschedule.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalschedule.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalschedule.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalschedulepatch.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalschedulepatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalschedulepatch.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalschedulepatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalscheduleproperties.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalscheduleproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_scalingplanpersonalscheduleproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_scalingplanpersonalscheduleproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_time.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_time.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/model_time.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/model_time.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/version.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/version.go similarity index 82% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/version.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/version.go index 37e6661e68b..5b5c68f9f85 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpersonalschedule/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpersonalschedule/version.go @@ -3,8 +3,8 @@ package scalingplanpersonalschedule // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/scalingplanpersonalschedule/2024-04-08-preview" + return "hashicorp/go-azure-sdk/scalingplanpersonalschedule/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/README.md b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/README.md similarity index 95% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/README.md rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/README.md index 8a6d5c3066b..3e97eb8750a 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule` Documentation -The `scalingplanpooledschedule` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `scalingplanpooledschedule` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/client.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/client.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/constants.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_pooledschedule.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_pooledschedule.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_pooledschedule.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_pooledschedule.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_pooledschedule_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_pooledschedule_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_pooledschedule_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_pooledschedule_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_scalingplan.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_scalingplan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_scalingplan.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_scalingplan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_scalingplan_test.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_scalingplan_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/id_scalingplan_test.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/id_scalingplan_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_create.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_create.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_create.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_create.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledschedule.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledschedule.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledschedule.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledschedule.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledschedulepatch.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledschedulepatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledschedulepatch.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledschedulepatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledscheduleproperties.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledscheduleproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_scalingplanpooledscheduleproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_scalingplanpooledscheduleproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_time.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_time.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/model_time.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/model_time.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/version.go b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/version.go similarity index 82% rename from resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/version.go rename to resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/version.go index 980b8afeed1..205c56b3eec 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplanpooledschedule/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/scalingplanpooledschedule/version.go @@ -3,8 +3,8 @@ package scalingplanpooledschedule // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/scalingplanpooledschedule/2024-04-08-preview" + return "hashicorp/go-azure-sdk/scalingplanpooledschedule/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/README.md b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/README.md similarity index 80% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/README.md rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/README.md index a92ac1a3b5b..94f487ebe26 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/sessionhost` Documentation -The `sessionhost` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `sessionhost` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/sessionhost" ``` @@ -69,22 +69,6 @@ for _, item := range items { ``` -### Example Usage: `SessionHostClient.RetryProvisioning` - -```go -ctx := context.TODO() -id := sessionhost.NewSessionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "sessionHostName") - -read, err := client.RetryProvisioning(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - ### Example Usage: `SessionHostClient.Update` ```go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/client.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/client.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/constants.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_sessionhost.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_sessionhost.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_sessionhost.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_sessionhost.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_sessionhost_test.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_sessionhost_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/id_sessionhost_test.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/id_sessionhost_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_list.go similarity index 97% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_list.go index ee42732f14f..0ecf840a9f7 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_list.go +++ b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_list.go @@ -27,7 +27,6 @@ type ListOperationOptions struct { InitialSkip *int64 IsDescending *bool PageSize *int64 - VMPath *string } func DefaultListOperationOptions() ListOperationOptions { @@ -57,9 +56,6 @@ func (o ListOperationOptions) ToQuery() *client.QueryParams { if o.PageSize != nil { out.Append("pageSize", fmt.Sprintf("%v", *o.PageSize)) } - if o.VMPath != nil { - out.Append("vmPath", fmt.Sprintf("%v", *o.VMPath)) - } return &out } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhost.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhost.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhost.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhost.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhosthealthcheckfailuredetails.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhosthealthcheckfailuredetails.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhosthealthcheckfailuredetails.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhosthealthcheckfailuredetails.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhosthealthcheckreport.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhosthealthcheckreport.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhosthealthcheckreport.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhosthealthcheckreport.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostpatch.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostpatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostpatch.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostpatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostpatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostpatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostpatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostproperties.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostproperties.go similarity index 82% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostproperties.go index 5d959e46bed..76792b5d7f4 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/model_sessionhostproperties.go +++ b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/model_sessionhostproperties.go @@ -15,12 +15,10 @@ type SessionHostProperties struct { AssignedUser *string `json:"assignedUser,omitempty"` FriendlyName *string `json:"friendlyName,omitempty"` LastHeartBeat *string `json:"lastHeartBeat,omitempty"` - LastSessionHostUpdateTime *string `json:"lastSessionHostUpdateTime,omitempty"` LastUpdateTime *string `json:"lastUpdateTime,omitempty"` ObjectId *string `json:"objectId,omitempty"` OsVersion *string `json:"osVersion,omitempty"` ResourceId *string `json:"resourceId,omitempty"` - SessionHostConfiguration *string `json:"sessionHostConfiguration,omitempty"` SessionHostHealthCheckResults *[]SessionHostHealthCheckReport `json:"sessionHostHealthCheckResults,omitempty"` Sessions *int64 `json:"sessions,omitempty"` Status *Status `json:"status,omitempty"` @@ -43,18 +41,6 @@ func (o *SessionHostProperties) SetLastHeartBeatAsTime(input time.Time) { o.LastHeartBeat = &formatted } -func (o *SessionHostProperties) GetLastSessionHostUpdateTimeAsTime() (*time.Time, error) { - if o.LastSessionHostUpdateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSessionHostUpdateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostProperties) SetLastSessionHostUpdateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSessionHostUpdateTime = &formatted -} - func (o *SessionHostProperties) GetLastUpdateTimeAsTime() (*time.Time, error) { if o.LastUpdateTime == nil { return nil, nil diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/version.go b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/version.go rename to resource-manager/desktopvirtualization/2024-04-03/sessionhost/version.go index b859e4aad26..8e657733a1b 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhost/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/sessionhost/version.go @@ -3,8 +3,8 @@ package sessionhost // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/sessionhost/2024-04-08-preview" + return "hashicorp/go-azure-sdk/sessionhost/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/README.md b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/README.md similarity index 85% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/README.md rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/README.md index c44f2fb0173..92b061d84de 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/startmenuitem` Documentation -The `startmenuitem` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `startmenuitem` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/startmenuitem" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/client.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/client.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/id_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/id_applicationgroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/id_applicationgroup.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/id_applicationgroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/id_applicationgroup_test.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/id_applicationgroup_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/id_applicationgroup_test.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/id_applicationgroup_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/model_startmenuitem.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/model_startmenuitem.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/model_startmenuitem.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/model_startmenuitem.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/model_startmenuitemproperties.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/model_startmenuitemproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/model_startmenuitemproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/model_startmenuitemproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/version.go b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/version.go similarity index 64% rename from resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/version.go rename to resource-manager/desktopvirtualization/2024-04-03/startmenuitem/version.go index 3b95a819bcf..fa36bafea9f 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/startmenuitem/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/startmenuitem/version.go @@ -3,8 +3,8 @@ package startmenuitem // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/startmenuitem/2024-04-08-preview" + return "hashicorp/go-azure-sdk/startmenuitem/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/README.md b/resource-manager/desktopvirtualization/2024-04-03/usersession/README.md similarity index 94% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/README.md rename to resource-manager/desktopvirtualization/2024-04-03/usersession/README.md index 12f6e39cb15..8c7f52d00d4 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/usersession/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/usersession` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/usersession` Documentation -The `usersession` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `usersession` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/usersession" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/usersession" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/client.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/client.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/constants.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_hostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_hostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_hostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_hostpool_test.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_hostpool_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_hostpool_test.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_hostpool_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_sessionhost.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_sessionhost.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_sessionhost.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_sessionhost.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_sessionhost_test.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_sessionhost_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_sessionhost_test.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_sessionhost_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_usersession.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_usersession.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_usersession.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_usersession.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_usersession_test.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/id_usersession_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/id_usersession_test.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/id_usersession_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_disconnect.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_disconnect.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_disconnect.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_disconnect.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_list.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_list.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_list.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_list.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_listbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_listbyhostpool.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_listbyhostpool.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_listbyhostpool.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_sendmessage.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/method_sendmessage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/method_sendmessage.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/method_sendmessage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_sendmessage.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/model_sendmessage.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_sendmessage.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/model_sendmessage.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_usersession.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/model_usersession.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_usersession.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/model_usersession.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_usersessionproperties.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/model_usersessionproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/model_usersessionproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/model_usersessionproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/version.go b/resource-manager/desktopvirtualization/2024-04-03/usersession/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/usersession/version.go rename to resource-manager/desktopvirtualization/2024-04-03/usersession/version.go index 16daafc162b..343f0a00372 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/usersession/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/usersession/version.go @@ -3,8 +3,8 @@ package usersession // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/usersession/2024-04-08-preview" + return "hashicorp/go-azure-sdk/usersession/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/README.md b/resource-manager/desktopvirtualization/2024-04-03/workspace/README.md similarity index 94% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/README.md rename to resource-manager/desktopvirtualization/2024-04-03/workspace/README.md index 94f8dd82ce6..39858e939a3 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/README.md +++ b/resource-manager/desktopvirtualization/2024-04-03/workspace/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/workspace` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/workspace` Documentation -The `workspace` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). +The `workspace` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-03`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/workspace" +import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-03/workspace" ``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/client.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/client.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/client.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/client.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/constants.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/constants.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/constants.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/constants.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/id_workspace.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/id_workspace.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/id_workspace.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/id_workspace.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/id_workspace_test.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/id_workspace_test.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/id_workspace_test.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/id_workspace_test.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_createorupdate.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_createorupdate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_createorupdate.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_createorupdate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_delete.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_delete.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_delete.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_delete.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_get.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_get.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_get.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_get.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_listbyresourcegroup.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_listbyresourcegroup.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_listbyresourcegroup.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_listbysubscription.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_listbysubscription.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_listbysubscription.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_listbysubscription.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_update.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/method_update.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/method_update.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/method_update.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_plan.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_plan.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_plan.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_plan.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpoint.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpoint.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpoint.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpoint.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpointconnection.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpointconnection.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpointconnection.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpointconnection.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpointconnectionproperties.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpointconnectionproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privateendpointconnectionproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_privateendpointconnectionproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privatelinkserviceconnectionstate.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_privatelinkserviceconnectionstate.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_sku.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_sku.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_sku.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_sku.go diff --git a/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspace.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspace.go new file mode 100644 index 00000000000..2ec700bc4da --- /dev/null +++ b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspace.go @@ -0,0 +1,25 @@ +package workspace + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Workspace struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAssigned `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + ManagedBy *string `json:"managedBy,omitempty"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties *WorkspaceProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspacepatch.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspacepatch.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspacepatch.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspacepatch.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspacepatchproperties.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspacepatchproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspacepatchproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspacepatchproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspaceproperties.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspaceproperties.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspaceproperties.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/model_workspaceproperties.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/predicates.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/predicates.go similarity index 100% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/predicates.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/predicates.go diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/version.go b/resource-manager/desktopvirtualization/2024-04-03/workspace/version.go similarity index 65% rename from resource-manager/desktopvirtualization/2024-04-08-preview/workspace/version.go rename to resource-manager/desktopvirtualization/2024-04-03/workspace/version.go index 5cbdd8008c7..32e25043aae 100644 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/version.go +++ b/resource-manager/desktopvirtualization/2024-04-03/workspace/version.go @@ -3,8 +3,8 @@ package workspace // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2024-04-08-preview" +const defaultApiVersion = "2024-04-03" func userAgent() string { - return "hashicorp/go-azure-sdk/workspace/2024-04-08-preview" + return "hashicorp/go-azure-sdk/workspace/2024-04-03" } diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/README.md b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/README.md deleted file mode 100644 index 2db006d3a50..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration` Documentation - -The `activesessionhostconfiguration` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration" -``` - - -### Client Initialization - -```go -client := activesessionhostconfiguration.NewActiveSessionHostConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ActiveSessionHostConfigurationClient.Get` - -```go -ctx := context.TODO() -id := activesessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ActiveSessionHostConfigurationClient.ListByHostPool` - -```go -ctx := context.TODO() -id := activesessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -// alternatively `client.ListByHostPool(ctx, id)` can be used to do batched pagination -items, err := client.ListByHostPoolComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/client.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/client.go deleted file mode 100644 index aeca0750442..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package activesessionhostconfiguration - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveSessionHostConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewActiveSessionHostConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*ActiveSessionHostConfigurationClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "activesessionhostconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ActiveSessionHostConfigurationClient: %+v", err) - } - - return &ActiveSessionHostConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/constants.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/constants.go deleted file mode 100644 index 0f2f08464fb..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/constants.go +++ /dev/null @@ -1,180 +0,0 @@ -package activesessionhostconfiguration - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DomainJoinType string - -const ( - DomainJoinTypeActiveDirectory DomainJoinType = "ActiveDirectory" - DomainJoinTypeAzureActiveDirectory DomainJoinType = "AzureActiveDirectory" -) - -func PossibleValuesForDomainJoinType() []string { - return []string{ - string(DomainJoinTypeActiveDirectory), - string(DomainJoinTypeAzureActiveDirectory), - } -} - -func (s *DomainJoinType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDomainJoinType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDomainJoinType(input string) (*DomainJoinType, error) { - vals := map[string]DomainJoinType{ - "activedirectory": DomainJoinTypeActiveDirectory, - "azureactivedirectory": DomainJoinTypeAzureActiveDirectory, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DomainJoinType(input) - return &out, nil -} - -type Type string - -const ( - TypeCustom Type = "Custom" - TypeMarketplace Type = "Marketplace" -) - -func PossibleValuesForType() []string { - return []string{ - string(TypeCustom), - string(TypeMarketplace), - } -} - -func (s *Type) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseType(input string) (*Type, error) { - vals := map[string]Type{ - "custom": TypeCustom, - "marketplace": TypeMarketplace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Type(input) - return &out, nil -} - -type VirtualMachineDiskType string - -const ( - VirtualMachineDiskTypePremiumLRS VirtualMachineDiskType = "Premium_LRS" - VirtualMachineDiskTypeStandardLRS VirtualMachineDiskType = "Standard_LRS" - VirtualMachineDiskTypeStandardSSDLRS VirtualMachineDiskType = "StandardSSD_LRS" -) - -func PossibleValuesForVirtualMachineDiskType() []string { - return []string{ - string(VirtualMachineDiskTypePremiumLRS), - string(VirtualMachineDiskTypeStandardLRS), - string(VirtualMachineDiskTypeStandardSSDLRS), - } -} - -func (s *VirtualMachineDiskType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineDiskType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineDiskType(input string) (*VirtualMachineDiskType, error) { - vals := map[string]VirtualMachineDiskType{ - "premium_lrs": VirtualMachineDiskTypePremiumLRS, - "standard_lrs": VirtualMachineDiskTypeStandardLRS, - "standardssd_lrs": VirtualMachineDiskTypeStandardSSDLRS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineDiskType(input) - return &out, nil -} - -type VirtualMachineSecurityType string - -const ( - VirtualMachineSecurityTypeConfidentialVM VirtualMachineSecurityType = "ConfidentialVM" - VirtualMachineSecurityTypeStandard VirtualMachineSecurityType = "Standard" - VirtualMachineSecurityTypeTrustedLaunch VirtualMachineSecurityType = "TrustedLaunch" -) - -func PossibleValuesForVirtualMachineSecurityType() []string { - return []string{ - string(VirtualMachineSecurityTypeConfidentialVM), - string(VirtualMachineSecurityTypeStandard), - string(VirtualMachineSecurityTypeTrustedLaunch), - } -} - -func (s *VirtualMachineSecurityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineSecurityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineSecurityType(input string) (*VirtualMachineSecurityType, error) { - vals := map[string]VirtualMachineSecurityType{ - "confidentialvm": VirtualMachineSecurityTypeConfidentialVM, - "standard": VirtualMachineSecurityTypeStandard, - "trustedlaunch": VirtualMachineSecurityTypeTrustedLaunch, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineSecurityType(input) - return &out, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool.go deleted file mode 100644 index a657ca503dc..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/id_hostpool.go +++ /dev/null @@ -1,130 +0,0 @@ -package activesessionhostconfiguration - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&HostPoolId{}) -} - -var _ resourceids.ResourceId = &HostPoolId{} - -// HostPoolId is a struct representing the Resource ID for a Host Pool -type HostPoolId struct { - SubscriptionId string - ResourceGroupName string - HostPoolName string -} - -// NewHostPoolID returns a new HostPoolId struct -func NewHostPoolID(subscriptionId string, resourceGroupName string, hostPoolName string) HostPoolId { - return HostPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - HostPoolName: hostPoolName, - } -} - -// ParseHostPoolID parses 'input' into a HostPoolId -func ParseHostPoolID(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHostPoolIDInsensitively parses 'input' case-insensitively into a HostPoolId -// note: this method should only be used for API response data and not user input -func ParseHostPoolIDInsensitively(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HostPoolId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.HostPoolName, ok = input.Parsed["hostPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hostPoolName", input) - } - - return nil -} - -// ValidateHostPoolID checks that 'input' can be parsed as a Host Pool ID -func ValidateHostPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseHostPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Host Pool ID -func (id HostPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DesktopVirtualization/hostPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Host Pool ID -func (id HostPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftDesktopVirtualization", "Microsoft.DesktopVirtualization", "Microsoft.DesktopVirtualization"), - resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), - resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), - } -} - -// String returns a human-readable description of this Host Pool ID -func (id HostPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Host Pool Name: %q", id.HostPoolName), - } - return fmt.Sprintf("Host Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_listbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_listbyhostpool.go deleted file mode 100644 index cdc313718ef..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/method_listbyhostpool.go +++ /dev/null @@ -1,105 +0,0 @@ -package activesessionhostconfiguration - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListByHostPoolOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ActiveSessionHostConfiguration -} - -type ListByHostPoolCompleteResult struct { - LatestHttpResponse *http.Response - Items []ActiveSessionHostConfiguration -} - -type ListByHostPoolCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *ListByHostPoolCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// ListByHostPool ... -func (c ActiveSessionHostConfigurationClient) ListByHostPool(ctx context.Context, id HostPoolId) (result ListByHostPoolOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &ListByHostPoolCustomPager{}, - Path: fmt.Sprintf("%s/activeSessionHostConfigurations", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ActiveSessionHostConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByHostPoolComplete retrieves all the results into a single object -func (c ActiveSessionHostConfigurationClient) ListByHostPoolComplete(ctx context.Context, id HostPoolId) (ListByHostPoolCompleteResult, error) { - return c.ListByHostPoolCompleteMatchingPredicate(ctx, id, ActiveSessionHostConfigurationOperationPredicate{}) -} - -// ListByHostPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ActiveSessionHostConfigurationClient) ListByHostPoolCompleteMatchingPredicate(ctx context.Context, id HostPoolId, predicate ActiveSessionHostConfigurationOperationPredicate) (result ListByHostPoolCompleteResult, err error) { - items := make([]ActiveSessionHostConfiguration, 0) - - resp, err := c.ListByHostPool(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListByHostPoolCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activedirectoryinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activedirectoryinfoproperties.go deleted file mode 100644 index bd488489f3e..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activedirectoryinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryInfoProperties struct { - DomainCredentials KeyVaultCredentialsProperties `json:"domainCredentials"` - DomainName *string `json:"domainName,omitempty"` - OuPath string `json:"ouPath"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfiguration.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfiguration.go deleted file mode 100644 index 30ff8f3befb..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package activesessionhostconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveSessionHostConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ActiveSessionHostConfigurationProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfigurationproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfigurationproperties.go deleted file mode 100644 index 57154777ee1..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_activesessionhostconfigurationproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package activesessionhostconfiguration - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveSessionHostConfigurationProperties struct { - AvailabilityZones *[]int64 `json:"availabilityZones,omitempty"` - BootDiagnosticsInfo *BootDiagnosticsInfoProperties `json:"bootDiagnosticsInfo,omitempty"` - CustomConfigurationScriptURL *string `json:"customConfigurationScriptUrl,omitempty"` - DiskInfo DiskInfoProperties `json:"diskInfo"` - DomainInfo DomainInfoProperties `json:"domainInfo"` - FriendlyName *string `json:"friendlyName,omitempty"` - ImageInfo ImageInfoProperties `json:"imageInfo"` - NetworkInfo NetworkInfoProperties `json:"networkInfo"` - SecurityInfo *SecurityInfoProperties `json:"securityInfo,omitempty"` - VMAdminCredentials KeyVaultCredentialsProperties `json:"vmAdminCredentials"` - VMLocation *string `json:"vmLocation,omitempty"` - VMNamePrefix string `json:"vmNamePrefix"` - VMResourceGroup *string `json:"vmResourceGroup,omitempty"` - VMSizeId string `json:"vmSizeId"` - VMTags *map[string]string `json:"vmTags,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *ActiveSessionHostConfigurationProperties) GetVersionAsTime() (*time.Time, error) { - if o.Version == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Version, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveSessionHostConfigurationProperties) SetVersionAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Version = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_bootdiagnosticsinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_bootdiagnosticsinfoproperties.go deleted file mode 100644 index cb0e58c3ad9..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_bootdiagnosticsinfoproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BootDiagnosticsInfoProperties struct { - Enabled *bool `json:"enabled,omitempty"` - StorageUri *string `json:"storageUri,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_domaininfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_domaininfoproperties.go deleted file mode 100644 index 928ac8045a0..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_domaininfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DomainInfoProperties struct { - ActiveDirectoryInfo *ActiveDirectoryInfoProperties `json:"activeDirectoryInfo,omitempty"` - AzureActiveDirectoryInfo *AzureActiveDirectoryInfoProperties `json:"azureActiveDirectoryInfo,omitempty"` - JoinType DomainJoinType `json:"joinType"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_imageinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_imageinfoproperties.go deleted file mode 100644 index be782b67e35..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_imageinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageInfoProperties struct { - CustomInfo *CustomInfoProperties `json:"customInfo,omitempty"` - MarketplaceInfo *MarketplaceInfoProperties `json:"marketplaceInfo,omitempty"` - Type Type `json:"type"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_keyvaultcredentialsproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_keyvaultcredentialsproperties.go deleted file mode 100644 index 344958ab802..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_keyvaultcredentialsproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultCredentialsProperties struct { - PasswordKeyVaultSecretUri string `json:"passwordKeyVaultSecretUri"` - UsernameKeyVaultSecretUri string `json:"usernameKeyVaultSecretUri"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_marketplaceinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_marketplaceinfoproperties.go deleted file mode 100644 index 4fa46eafd08..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_marketplaceinfoproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceInfoProperties struct { - ExactVersion string `json:"exactVersion"` - Offer string `json:"offer"` - Publisher string `json:"publisher"` - Sku string `json:"sku"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_networkinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_networkinfoproperties.go deleted file mode 100644 index 3d31187ef11..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_networkinfoproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInfoProperties struct { - SecurityGroupId *string `json:"securityGroupId,omitempty"` - SubnetId string `json:"subnetId"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_securityinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_securityinfoproperties.go deleted file mode 100644 index 8c2fc50f195..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/model_securityinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityInfoProperties struct { - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - Type *VirtualMachineSecurityType `json:"type,omitempty"` - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/version.go b/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/version.go deleted file mode 100644 index d07d3bea6fc..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/activesessionhostconfiguration/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package activesessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2024-04-08-preview" - -func userAgent() string { - return "hashicorp/go-azure-sdk/activesessionhostconfiguration/2024-04-08-preview" -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroup.go b/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroup.go deleted file mode 100644 index c8b71e5f22d..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/applicationgroup/model_applicationgroup.go +++ /dev/null @@ -1,25 +0,0 @@ -package applicationgroup - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` - Kind *string `json:"kind,omitempty"` - Location string `json:"location"` - ManagedBy *string `json:"managedBy,omitempty"` - Name *string `json:"name,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Properties ApplicationGroupProperties `json:"properties"` - Sku *Sku `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpool.go deleted file mode 100644 index aa285f513c7..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/hostpool/model_hostpool.go +++ /dev/null @@ -1,25 +0,0 @@ -package hostpool - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` - Kind *string `json:"kind,omitempty"` - Location string `json:"location"` - ManagedBy *string `json:"managedBy,omitempty"` - Name *string `json:"name,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Properties HostPoolProperties `json:"properties"` - Sku *Sku `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplan.go b/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplan.go deleted file mode 100644 index 0bea4d2f691..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/scalingplan/model_scalingplan.go +++ /dev/null @@ -1,25 +0,0 @@ -package scalingplan - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScalingPlan struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` - Kind *string `json:"kind,omitempty"` - Location string `json:"location"` - ManagedBy *string `json:"managedBy,omitempty"` - Name *string `json:"name,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Properties ScalingPlanProperties `json:"properties"` - Sku *Sku `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/README.md b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/README.md deleted file mode 100644 index e515675805a..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/README.md +++ /dev/null @@ -1,87 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration` Documentation - -The `sessionhostconfiguration` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration" -``` - - -### Client Initialization - -```go -client := sessionhostconfiguration.NewSessionHostConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SessionHostConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := sessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostconfiguration.SessionHostConfiguration{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SessionHostConfigurationClient.Get` - -```go -ctx := context.TODO() -id := sessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SessionHostConfigurationClient.ListByHostPool` - -```go -ctx := context.TODO() -id := sessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -// alternatively `client.ListByHostPool(ctx, id)` can be used to do batched pagination -items, err := client.ListByHostPoolComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `SessionHostConfigurationClient.Update` - -```go -ctx := context.TODO() -id := sessionhostconfiguration.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostconfiguration.SessionHostConfigurationPatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/client.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/client.go deleted file mode 100644 index 858aa93caa7..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sessionhostconfiguration - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewSessionHostConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*SessionHostConfigurationClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "sessionhostconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SessionHostConfigurationClient: %+v", err) - } - - return &SessionHostConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/constants.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/constants.go deleted file mode 100644 index 03914dda4d1..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package sessionhostconfiguration - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DomainJoinType string - -const ( - DomainJoinTypeActiveDirectory DomainJoinType = "ActiveDirectory" - DomainJoinTypeAzureActiveDirectory DomainJoinType = "AzureActiveDirectory" -) - -func PossibleValuesForDomainJoinType() []string { - return []string{ - string(DomainJoinTypeActiveDirectory), - string(DomainJoinTypeAzureActiveDirectory), - } -} - -func (s *DomainJoinType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDomainJoinType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDomainJoinType(input string) (*DomainJoinType, error) { - vals := map[string]DomainJoinType{ - "activedirectory": DomainJoinTypeActiveDirectory, - "azureactivedirectory": DomainJoinTypeAzureActiveDirectory, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DomainJoinType(input) - return &out, nil -} - -type ProvisioningStateSHC string - -const ( - ProvisioningStateSHCCanceled ProvisioningStateSHC = "Canceled" - ProvisioningStateSHCFailed ProvisioningStateSHC = "Failed" - ProvisioningStateSHCProvisioning ProvisioningStateSHC = "Provisioning" - ProvisioningStateSHCSucceeded ProvisioningStateSHC = "Succeeded" -) - -func PossibleValuesForProvisioningStateSHC() []string { - return []string{ - string(ProvisioningStateSHCCanceled), - string(ProvisioningStateSHCFailed), - string(ProvisioningStateSHCProvisioning), - string(ProvisioningStateSHCSucceeded), - } -} - -func (s *ProvisioningStateSHC) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateSHC(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateSHC(input string) (*ProvisioningStateSHC, error) { - vals := map[string]ProvisioningStateSHC{ - "canceled": ProvisioningStateSHCCanceled, - "failed": ProvisioningStateSHCFailed, - "provisioning": ProvisioningStateSHCProvisioning, - "succeeded": ProvisioningStateSHCSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateSHC(input) - return &out, nil -} - -type Type string - -const ( - TypeCustom Type = "Custom" - TypeMarketplace Type = "Marketplace" -) - -func PossibleValuesForType() []string { - return []string{ - string(TypeCustom), - string(TypeMarketplace), - } -} - -func (s *Type) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseType(input string) (*Type, error) { - vals := map[string]Type{ - "custom": TypeCustom, - "marketplace": TypeMarketplace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Type(input) - return &out, nil -} - -type VirtualMachineDiskType string - -const ( - VirtualMachineDiskTypePremiumLRS VirtualMachineDiskType = "Premium_LRS" - VirtualMachineDiskTypeStandardLRS VirtualMachineDiskType = "Standard_LRS" - VirtualMachineDiskTypeStandardSSDLRS VirtualMachineDiskType = "StandardSSD_LRS" -) - -func PossibleValuesForVirtualMachineDiskType() []string { - return []string{ - string(VirtualMachineDiskTypePremiumLRS), - string(VirtualMachineDiskTypeStandardLRS), - string(VirtualMachineDiskTypeStandardSSDLRS), - } -} - -func (s *VirtualMachineDiskType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineDiskType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineDiskType(input string) (*VirtualMachineDiskType, error) { - vals := map[string]VirtualMachineDiskType{ - "premium_lrs": VirtualMachineDiskTypePremiumLRS, - "standard_lrs": VirtualMachineDiskTypeStandardLRS, - "standardssd_lrs": VirtualMachineDiskTypeStandardSSDLRS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineDiskType(input) - return &out, nil -} - -type VirtualMachineSecurityType string - -const ( - VirtualMachineSecurityTypeConfidentialVM VirtualMachineSecurityType = "ConfidentialVM" - VirtualMachineSecurityTypeStandard VirtualMachineSecurityType = "Standard" - VirtualMachineSecurityTypeTrustedLaunch VirtualMachineSecurityType = "TrustedLaunch" -) - -func PossibleValuesForVirtualMachineSecurityType() []string { - return []string{ - string(VirtualMachineSecurityTypeConfidentialVM), - string(VirtualMachineSecurityTypeStandard), - string(VirtualMachineSecurityTypeTrustedLaunch), - } -} - -func (s *VirtualMachineSecurityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineSecurityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineSecurityType(input string) (*VirtualMachineSecurityType, error) { - vals := map[string]VirtualMachineSecurityType{ - "confidentialvm": VirtualMachineSecurityTypeConfidentialVM, - "standard": VirtualMachineSecurityTypeStandard, - "trustedlaunch": VirtualMachineSecurityTypeTrustedLaunch, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineSecurityType(input) - return &out, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool.go deleted file mode 100644 index fe338fa5869..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/id_hostpool.go +++ /dev/null @@ -1,130 +0,0 @@ -package sessionhostconfiguration - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&HostPoolId{}) -} - -var _ resourceids.ResourceId = &HostPoolId{} - -// HostPoolId is a struct representing the Resource ID for a Host Pool -type HostPoolId struct { - SubscriptionId string - ResourceGroupName string - HostPoolName string -} - -// NewHostPoolID returns a new HostPoolId struct -func NewHostPoolID(subscriptionId string, resourceGroupName string, hostPoolName string) HostPoolId { - return HostPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - HostPoolName: hostPoolName, - } -} - -// ParseHostPoolID parses 'input' into a HostPoolId -func ParseHostPoolID(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHostPoolIDInsensitively parses 'input' case-insensitively into a HostPoolId -// note: this method should only be used for API response data and not user input -func ParseHostPoolIDInsensitively(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HostPoolId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.HostPoolName, ok = input.Parsed["hostPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hostPoolName", input) - } - - return nil -} - -// ValidateHostPoolID checks that 'input' can be parsed as a Host Pool ID -func ValidateHostPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseHostPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Host Pool ID -func (id HostPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DesktopVirtualization/hostPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Host Pool ID -func (id HostPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftDesktopVirtualization", "Microsoft.DesktopVirtualization", "Microsoft.DesktopVirtualization"), - resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), - resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), - } -} - -// String returns a human-readable description of this Host Pool ID -func (id HostPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Host Pool Name: %q", id.HostPoolName), - } - return fmt.Sprintf("Host Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_listbyhostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_listbyhostpool.go deleted file mode 100644 index 59e4c0d6dcc..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/method_listbyhostpool.go +++ /dev/null @@ -1,105 +0,0 @@ -package sessionhostconfiguration - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListByHostPoolOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SessionHostConfiguration -} - -type ListByHostPoolCompleteResult struct { - LatestHttpResponse *http.Response - Items []SessionHostConfiguration -} - -type ListByHostPoolCustomPager struct { - NextLink *odata.Link `json:"nextLink"` -} - -func (p *ListByHostPoolCustomPager) NextPageLink() *odata.Link { - defer func() { - p.NextLink = nil - }() - - return p.NextLink -} - -// ListByHostPool ... -func (c SessionHostConfigurationClient) ListByHostPool(ctx context.Context, id HostPoolId) (result ListByHostPoolOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Pager: &ListByHostPoolCustomPager{}, - Path: fmt.Sprintf("%s/sessionHostConfigurations", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]SessionHostConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByHostPoolComplete retrieves all the results into a single object -func (c SessionHostConfigurationClient) ListByHostPoolComplete(ctx context.Context, id HostPoolId) (ListByHostPoolCompleteResult, error) { - return c.ListByHostPoolCompleteMatchingPredicate(ctx, id, SessionHostConfigurationOperationPredicate{}) -} - -// ListByHostPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SessionHostConfigurationClient) ListByHostPoolCompleteMatchingPredicate(ctx context.Context, id HostPoolId, predicate SessionHostConfigurationOperationPredicate) (result ListByHostPoolCompleteResult, err error) { - items := make([]SessionHostConfiguration, 0) - - resp, err := c.ListByHostPool(ctx, id) - if err != nil { - result.LatestHttpResponse = resp.HttpResponse - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListByHostPoolCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfopatchproperties.go deleted file mode 100644 index 3d69c0e29a8..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfopatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryInfoPatchProperties struct { - DomainCredentials *KeyVaultCredentialsPatchProperties `json:"domainCredentials,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfoproperties.go deleted file mode 100644 index 7ec2ee5df8e..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_activedirectoryinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryInfoProperties struct { - DomainCredentials KeyVaultCredentialsProperties `json:"domainCredentials"` - DomainName *string `json:"domainName,omitempty"` - OuPath string `json:"ouPath"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfopatchproperties.go deleted file mode 100644 index f0036203ebb..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfopatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BootDiagnosticsInfoPatchProperties struct { - Enabled *bool `json:"enabled,omitempty"` - StorageUri *string `json:"storageUri,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfoproperties.go deleted file mode 100644 index f249d414d19..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_bootdiagnosticsinfoproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BootDiagnosticsInfoProperties struct { - Enabled *bool `json:"enabled,omitempty"` - StorageUri *string `json:"storageUri,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfopatchproperties.go deleted file mode 100644 index 2eff60be728..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_diskinfopatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskInfoPatchProperties struct { - Type *VirtualMachineDiskType `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfopatchproperties.go deleted file mode 100644 index 5cae01d2c9e..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfopatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DomainInfoPatchProperties struct { - ActiveDirectoryInfo *ActiveDirectoryInfoPatchProperties `json:"activeDirectoryInfo,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfoproperties.go deleted file mode 100644 index e3377b07ca1..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_domaininfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DomainInfoProperties struct { - ActiveDirectoryInfo *ActiveDirectoryInfoProperties `json:"activeDirectoryInfo,omitempty"` - AzureActiveDirectoryInfo *AzureActiveDirectoryInfoProperties `json:"azureActiveDirectoryInfo,omitempty"` - JoinType DomainJoinType `json:"joinType"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfopatchproperties.go deleted file mode 100644 index eb7678681da..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfopatchproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageInfoPatchProperties struct { - CustomInfo *CustomInfoPatchProperties `json:"customInfo,omitempty"` - MarketplaceInfo *MarketplaceInfoPatchProperties `json:"marketplaceInfo,omitempty"` - Type *Type `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfoproperties.go deleted file mode 100644 index e49aa2d5ebc..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_imageinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageInfoProperties struct { - CustomInfo *CustomInfoProperties `json:"customInfo,omitempty"` - MarketplaceInfo *MarketplaceInfoProperties `json:"marketplaceInfo,omitempty"` - Type Type `json:"type"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialspatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialspatchproperties.go deleted file mode 100644 index 7ecd74fe753..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialspatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultCredentialsPatchProperties struct { - PasswordKeyVaultSecretUri *string `json:"passwordKeyVaultSecretUri,omitempty"` - UsernameKeyVaultSecretUri *string `json:"usernameKeyVaultSecretUri,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialsproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialsproperties.go deleted file mode 100644 index 7cbb0d9ad6f..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_keyvaultcredentialsproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultCredentialsProperties struct { - PasswordKeyVaultSecretUri string `json:"passwordKeyVaultSecretUri"` - UsernameKeyVaultSecretUri string `json:"usernameKeyVaultSecretUri"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfopatchproperties.go deleted file mode 100644 index 9d4cac36455..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfopatchproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceInfoPatchProperties struct { - ExactVersion *string `json:"exactVersion,omitempty"` - Offer *string `json:"offer,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Sku *string `json:"sku,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfoproperties.go deleted file mode 100644 index e7eeb4581b3..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_marketplaceinfoproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceInfoProperties struct { - ExactVersion string `json:"exactVersion"` - Offer string `json:"offer"` - Publisher string `json:"publisher"` - Sku string `json:"sku"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfopatchproperties.go deleted file mode 100644 index 0ce4da5160e..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfopatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInfoPatchProperties struct { - SecurityGroupId *string `json:"securityGroupId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfoproperties.go deleted file mode 100644 index 5cab05b4558..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_networkinfoproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInfoProperties struct { - SecurityGroupId *string `json:"securityGroupId,omitempty"` - SubnetId string `json:"subnetId"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfopatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfopatchproperties.go deleted file mode 100644 index 0cd58f49c5c..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfopatchproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityInfoPatchProperties struct { - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - Type *VirtualMachineSecurityType `json:"type,omitempty"` - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfoproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfoproperties.go deleted file mode 100644 index a30e6db05a0..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_securityinfoproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityInfoProperties struct { - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - Type *VirtualMachineSecurityType `json:"type,omitempty"` - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatch.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatch.go deleted file mode 100644 index f53e3d97e30..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostConfigurationPatch struct { - Properties *SessionHostConfigurationPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatchproperties.go deleted file mode 100644 index 1e2c06d1764..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationpatchproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostConfigurationPatchProperties struct { - AvailabilityZones *[]int64 `json:"availabilityZones,omitempty"` - BootDiagnosticsInfo *BootDiagnosticsInfoPatchProperties `json:"bootDiagnosticsInfo,omitempty"` - CustomConfigurationScriptURL *string `json:"customConfigurationScriptUrl,omitempty"` - DiskInfo *DiskInfoPatchProperties `json:"diskInfo,omitempty"` - DomainInfo *DomainInfoPatchProperties `json:"domainInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ImageInfo *ImageInfoPatchProperties `json:"imageInfo,omitempty"` - NetworkInfo *NetworkInfoPatchProperties `json:"networkInfo,omitempty"` - SecurityInfo *SecurityInfoPatchProperties `json:"securityInfo,omitempty"` - VMAdminCredentials *KeyVaultCredentialsPatchProperties `json:"vmAdminCredentials,omitempty"` - VMLocation *string `json:"vmLocation,omitempty"` - VMNamePrefix *string `json:"vmNamePrefix,omitempty"` - VMResourceGroup *string `json:"vmResourceGroup,omitempty"` - VMSizeId *string `json:"vmSizeId,omitempty"` - VMTags *map[string]string `json:"vmTags,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationproperties.go deleted file mode 100644 index 335cd1d8abe..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/model_sessionhostconfigurationproperties.go +++ /dev/null @@ -1,42 +0,0 @@ -package sessionhostconfiguration - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostConfigurationProperties struct { - AvailabilityZones *[]int64 `json:"availabilityZones,omitempty"` - BootDiagnosticsInfo *BootDiagnosticsInfoProperties `json:"bootDiagnosticsInfo,omitempty"` - CustomConfigurationScriptURL *string `json:"customConfigurationScriptUrl,omitempty"` - DiskInfo DiskInfoProperties `json:"diskInfo"` - DomainInfo DomainInfoProperties `json:"domainInfo"` - FriendlyName *string `json:"friendlyName,omitempty"` - ImageInfo ImageInfoProperties `json:"imageInfo"` - NetworkInfo NetworkInfoProperties `json:"networkInfo"` - ProvisioningState *ProvisioningStateSHC `json:"provisioningState,omitempty"` - SecurityInfo *SecurityInfoProperties `json:"securityInfo,omitempty"` - VMAdminCredentials KeyVaultCredentialsProperties `json:"vmAdminCredentials"` - VMLocation *string `json:"vmLocation,omitempty"` - VMNamePrefix string `json:"vmNamePrefix"` - VMResourceGroup *string `json:"vmResourceGroup,omitempty"` - VMSizeId string `json:"vmSizeId"` - VMTags *map[string]string `json:"vmTags,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *SessionHostConfigurationProperties) GetVersionAsTime() (*time.Time, error) { - if o.Version == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Version, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostConfigurationProperties) SetVersionAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Version = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/version.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/version.go deleted file mode 100644 index a5f48c0ab06..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostconfiguration/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2024-04-08-preview" - -func userAgent() string { - return "hashicorp/go-azure-sdk/sessionhostconfiguration/2024-04-08-preview" -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/README.md b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/README.md deleted file mode 100644 index c96dd857213..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement` Documentation - -The `sessionhostmanagement` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement" -``` - - -### Client Initialization - -```go -client := sessionhostmanagement.NewSessionHostManagementClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SessionHostManagementClient.ControlSessionHostUpdatePost` - -```go -ctx := context.TODO() -id := sessionhostmanagement.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostmanagement.HostPoolUpdateControlParameter{ - // ... -} - - -if err := client.ControlSessionHostUpdatePostThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SessionHostManagementClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := sessionhostmanagement.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostmanagement.SessionHostManagement{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SessionHostManagementClient.InitiateSessionHostUpdatePost` - -```go -ctx := context.TODO() -id := sessionhostmanagement.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostmanagement.UpdateSessionHostsRequestBody{ - // ... -} - - -read, err := client.InitiateSessionHostUpdatePost(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SessionHostManagementClient.Update` - -```go -ctx := context.TODO() -id := sessionhostmanagement.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -payload := sessionhostmanagement.SessionHostManagementPatch{ - // ... -} - - -read, err := client.Update(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SessionHostManagementClient.UpdateStatusGet` - -```go -ctx := context.TODO() -id := sessionhostmanagement.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -read, err := client.UpdateStatusGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/client.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/client.go deleted file mode 100644 index 973adbe9f98..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sessionhostmanagement - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementClient struct { - Client *resourcemanager.Client -} - -func NewSessionHostManagementClientWithBaseURI(sdkApi sdkEnv.Api) (*SessionHostManagementClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "sessionhostmanagement", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SessionHostManagementClient: %+v", err) - } - - return &SessionHostManagementClient{ - Client: client, - }, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/constants.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/constants.go deleted file mode 100644 index c66144033c0..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package sessionhostmanagement - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPoolUpdateAction string - -const ( - HostPoolUpdateActionCancel HostPoolUpdateAction = "Cancel" - HostPoolUpdateActionPause HostPoolUpdateAction = "Pause" - HostPoolUpdateActionResume HostPoolUpdateAction = "Resume" - HostPoolUpdateActionRetry HostPoolUpdateAction = "Retry" - HostPoolUpdateActionStart HostPoolUpdateAction = "Start" -) - -func PossibleValuesForHostPoolUpdateAction() []string { - return []string{ - string(HostPoolUpdateActionCancel), - string(HostPoolUpdateActionPause), - string(HostPoolUpdateActionResume), - string(HostPoolUpdateActionRetry), - string(HostPoolUpdateActionStart), - } -} - -func (s *HostPoolUpdateAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHostPoolUpdateAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHostPoolUpdateAction(input string) (*HostPoolUpdateAction, error) { - vals := map[string]HostPoolUpdateAction{ - "cancel": HostPoolUpdateActionCancel, - "pause": HostPoolUpdateActionPause, - "resume": HostPoolUpdateActionResume, - "retry": HostPoolUpdateActionRetry, - "start": HostPoolUpdateActionStart, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HostPoolUpdateAction(input) - return &out, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_initiatesessionhostupdatepost.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_initiatesessionhostupdatepost.go deleted file mode 100644 index b0ee9b96d60..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/method_initiatesessionhostupdatepost.go +++ /dev/null @@ -1,51 +0,0 @@ -package sessionhostmanagement - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InitiateSessionHostUpdatePostOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// InitiateSessionHostUpdatePost ... -func (c SessionHostManagementClient) InitiateSessionHostUpdatePost(ctx context.Context, id HostPoolId, input UpdateSessionHostsRequestBody) (result InitiateSessionHostUpdatePostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/sessionHostManagements/default/initiateSessionHostUpdate", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - return -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_erroradditionalinfo.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_erroradditionalinfo.go deleted file mode 100644 index c2556ad4c8b..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorAdditionalInfo struct { - Info *interface{} `json:"info,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_errordetail.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_errordetail.go deleted file mode 100644 index cc54f6992b3..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_errordetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ErrorDetail struct { - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` - Code *string `json:"code,omitempty"` - Details *[]ErrorDetail `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationpatchproperties.go deleted file mode 100644 index 566b145e7c5..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationpatchproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPoolUpdateConfigurationPatchProperties struct { - DeleteOriginalVM *bool `json:"deleteOriginalVm,omitempty"` - LogOffDelayMinutes *int64 `json:"logOffDelayMinutes,omitempty"` - LogOffMessage *string `json:"logOffMessage,omitempty"` - MaxVMsRemoved *int64 `json:"maxVmsRemoved,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationproperties.go deleted file mode 100644 index f7ba0d302cd..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdateconfigurationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPoolUpdateConfigurationProperties struct { - DeleteOriginalVM *bool `json:"deleteOriginalVm,omitempty"` - LogOffDelayMinutes int64 `json:"logOffDelayMinutes"` - LogOffMessage *string `json:"logOffMessage,omitempty"` - MaxVMsRemoved int64 `json:"maxVmsRemoved"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdatecontrolparameter.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdatecontrolparameter.go deleted file mode 100644 index 2ebee670e4c..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_hostpoolupdatecontrolparameter.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPoolUpdateControlParameter struct { - Action HostPoolUpdateAction `json:"action"` - CancelMessage *string `json:"cancelMessage,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagement.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagement.go deleted file mode 100644 index d41a58bd678..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagement.go +++ /dev/null @@ -1,16 +0,0 @@ -package sessionhostmanagement - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagement struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties SessionHostManagementProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementoperationprogress.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementoperationprogress.go deleted file mode 100644 index 3b7400bfa60..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementoperationprogress.go +++ /dev/null @@ -1,30 +0,0 @@ -package sessionhostmanagement - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementOperationProgress struct { - ExecutionStartTime *string `json:"executionStartTime,omitempty"` - SessionHostsCompleted *int64 `json:"sessionHostsCompleted,omitempty"` - SessionHostsInProgress *int64 `json:"sessionHostsInProgress,omitempty"` - SessionHostsRollbackFailed *int64 `json:"sessionHostsRollbackFailed,omitempty"` - TotalSessionHosts *int64 `json:"totalSessionHosts,omitempty"` -} - -func (o *SessionHostManagementOperationProgress) GetExecutionStartTimeAsTime() (*time.Time, error) { - if o.ExecutionStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ExecutionStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostManagementOperationProgress) SetExecutionStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ExecutionStartTime = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatch.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatch.go deleted file mode 100644 index 6fdffb4a179..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementPatch struct { - Properties *SessionHostManagementPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatchproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatchproperties.go deleted file mode 100644 index e9802212afd..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementpatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementPatchProperties struct { - ScheduledDateTimeZone *string `json:"scheduledDateTimeZone,omitempty"` - Update *HostPoolUpdateConfigurationPatchProperties `json:"update,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementproperties.go deleted file mode 100644 index 4317906eb7f..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementProperties struct { - ScheduledDateTimeZone string `json:"scheduledDateTimeZone"` - Update HostPoolUpdateConfigurationProperties `json:"update"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatus.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatus.go deleted file mode 100644 index cd83a682db9..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatus.go +++ /dev/null @@ -1,45 +0,0 @@ -package sessionhostmanagement - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementUpdateStatus struct { - EndTime *string `json:"endTime,omitempty"` - Error *ErrorDetail `json:"error,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PercentComplete *float64 `json:"percentComplete,omitempty"` - Properties *SessionHostManagementUpdateStatusProperties `json:"properties,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status string `json:"status"` -} - -func (o *SessionHostManagementUpdateStatus) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostManagementUpdateStatus) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *SessionHostManagementUpdateStatus) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostManagementUpdateStatus) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatusproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatusproperties.go deleted file mode 100644 index e2ab84a838f..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_sessionhostmanagementupdatestatusproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package sessionhostmanagement - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementUpdateStatusProperties struct { - CorrelationId *string `json:"correlationId,omitempty"` - Progress *SessionHostManagementOperationProgress `json:"progress,omitempty"` - ScheduledDateTime *string `json:"scheduledDateTime,omitempty"` - SessionHostManagement *SessionHostManagement `json:"sessionHostManagement,omitempty"` -} - -func (o *SessionHostManagementUpdateStatusProperties) GetScheduledDateTimeAsTime() (*time.Time, error) { - if o.ScheduledDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ScheduledDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SessionHostManagementUpdateStatusProperties) SetScheduledDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ScheduledDateTime = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_updatesessionhostsrequestbody.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_updatesessionhostsrequestbody.go deleted file mode 100644 index 7bddeeb143d..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/model_updatesessionhostsrequestbody.go +++ /dev/null @@ -1,28 +0,0 @@ -package sessionhostmanagement - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateSessionHostsRequestBody struct { - ScheduledDateTime *string `json:"scheduledDateTime,omitempty"` - ScheduledDateTimeZone *string `json:"scheduledDateTimeZone,omitempty"` - Update *HostPoolUpdateConfigurationPatchProperties `json:"update,omitempty"` -} - -func (o *UpdateSessionHostsRequestBody) GetScheduledDateTimeAsTime() (*time.Time, error) { - if o.ScheduledDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ScheduledDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSessionHostsRequestBody) SetScheduledDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ScheduledDateTime = &formatted -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/version.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/version.go deleted file mode 100644 index b08ccf66215..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagement/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostmanagement - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2024-04-08-preview" - -func userAgent() string { - return "hashicorp/go-azure-sdk/sessionhostmanagement/2024-04-08-preview" -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/README.md b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/README.md deleted file mode 100644 index 3f3fb12cee8..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements` Documentation - -The `sessionhostmanagements` SDK allows for interaction with Azure Resource Manager `desktopvirtualization` (API Version `2024-04-08-preview`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements" -``` - - -### Client Initialization - -```go -client := sessionhostmanagements.NewSessionHostManagementsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SessionHostManagementsClient.Get` - -```go -ctx := context.TODO() -id := sessionhostmanagements.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SessionHostManagementsClient.ListByHostPool` - -```go -ctx := context.TODO() -id := sessionhostmanagements.NewHostPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName") - -// alternatively `client.ListByHostPool(ctx, id)` can be used to do batched pagination -items, err := client.ListByHostPoolComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/client.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/client.go deleted file mode 100644 index d2cee7341f1..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sessionhostmanagements - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementsClient struct { - Client *resourcemanager.Client -} - -func NewSessionHostManagementsClientWithBaseURI(sdkApi sdkEnv.Api) (*SessionHostManagementsClient, error) { - client, err := resourcemanager.NewClient(sdkApi, "sessionhostmanagements", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SessionHostManagementsClient: %+v", err) - } - - return &SessionHostManagementsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool.go deleted file mode 100644 index 49e4d5cc6f7..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/id_hostpool.go +++ /dev/null @@ -1,130 +0,0 @@ -package sessionhostmanagements - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&HostPoolId{}) -} - -var _ resourceids.ResourceId = &HostPoolId{} - -// HostPoolId is a struct representing the Resource ID for a Host Pool -type HostPoolId struct { - SubscriptionId string - ResourceGroupName string - HostPoolName string -} - -// NewHostPoolID returns a new HostPoolId struct -func NewHostPoolID(subscriptionId string, resourceGroupName string, hostPoolName string) HostPoolId { - return HostPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - HostPoolName: hostPoolName, - } -} - -// ParseHostPoolID parses 'input' into a HostPoolId -func ParseHostPoolID(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHostPoolIDInsensitively parses 'input' case-insensitively into a HostPoolId -// note: this method should only be used for API response data and not user input -func ParseHostPoolIDInsensitively(input string) (*HostPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&HostPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HostPoolId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HostPoolId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) - } - - if id.HostPoolName, ok = input.Parsed["hostPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hostPoolName", input) - } - - return nil -} - -// ValidateHostPoolID checks that 'input' can be parsed as a Host Pool ID -func ValidateHostPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseHostPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Host Pool ID -func (id HostPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DesktopVirtualization/hostPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Host Pool ID -func (id HostPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftDesktopVirtualization", "Microsoft.DesktopVirtualization", "Microsoft.DesktopVirtualization"), - resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), - resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), - } -} - -// String returns a human-readable description of this Host Pool ID -func (id HostPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Host Pool Name: %q", id.HostPoolName), - } - return fmt.Sprintf("Host Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_hostpoolupdateconfigurationproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_hostpoolupdateconfigurationproperties.go deleted file mode 100644 index a84ab7a3dfb..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_hostpoolupdateconfigurationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package sessionhostmanagements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostPoolUpdateConfigurationProperties struct { - DeleteOriginalVM *bool `json:"deleteOriginalVm,omitempty"` - LogOffDelayMinutes int64 `json:"logOffDelayMinutes"` - LogOffMessage *string `json:"logOffMessage,omitempty"` - MaxVMsRemoved int64 `json:"maxVmsRemoved"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagement.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagement.go deleted file mode 100644 index ad18752374f..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagement.go +++ /dev/null @@ -1,16 +0,0 @@ -package sessionhostmanagements - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagement struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties SessionHostManagementProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagementproperties.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagementproperties.go deleted file mode 100644 index 167782dbd4d..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/model_sessionhostmanagementproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sessionhostmanagements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionHostManagementProperties struct { - ScheduledDateTimeZone string `json:"scheduledDateTimeZone"` - Update HostPoolUpdateConfigurationProperties `json:"update"` -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/version.go b/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/version.go deleted file mode 100644 index b7e2d394b97..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/sessionhostmanagements/version.go +++ /dev/null @@ -1,10 +0,0 @@ -package sessionhostmanagements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2024-04-08-preview" - -func userAgent() string { - return "hashicorp/go-azure-sdk/sessionhostmanagements/2024-04-08-preview" -} diff --git a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspace.go b/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspace.go deleted file mode 100644 index d734cf10db6..00000000000 --- a/resource-manager/desktopvirtualization/2024-04-08-preview/workspace/model_workspace.go +++ /dev/null @@ -1,25 +0,0 @@ -package workspace - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Workspace struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` - Kind *string `json:"kind,omitempty"` - Location string `json:"location"` - ManagedBy *string `json:"managedBy,omitempty"` - Name *string `json:"name,omitempty"` - Plan *Plan `json:"plan,omitempty"` - Properties *WorkspaceProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -}